Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12: Deprecation warnings related to datetime.datetime.utcfromtimestamp #528

Closed
madhuravius opened this issue Jan 4, 2024 · 2 comments

Comments

@madhuravius
Copy link

Related to: python/cpython#103857

    from freezegun import freeze_time
.venv/lib/python3.12/site-packages/freezegun/__init__.py:8: in <module>
    from .api import freeze_time
.venv/lib/python3.12/site-packages/freezegun/api.py:19: in <module>
    from dateutil import parser
.venv/lib/python3.12/site-packages/dateutil/parser/__init__.py:2: in <module>
    from ._parser import parse, parser, parserinfo, ParserError
.venv/lib/python3.12/site-packages/dateutil/parser/_parser.py:50: in <module>
    from .. import tz
.venv/lib/python3.12/site-packages/dateutil/tz/__init__.py:2: in <module>
    from .tz import *
.venv/lib/python3.12/site-packages/dateutil/tz/tz.py:37: in <module>
    EPOCH = datetime.datetime.utcfromtimestamp(0)
E   DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).

Context: https://discuss.python.org/t/deprecating-utcnow-and-utcfromtimestamp/26221

I copied the formatting of other issues I saw on this board.

@bblommers
Copy link
Collaborator

This warning comes from the dateutil module, not from us:

from dateutil import parser

Looks like this has already been raised with them:

dateutil/dateutil#1314

@madhuravius
Copy link
Author

My mistake for not digging deeper. Will close as it looks like the base requirements is already referencing > as what this is likely to be a minor version update from them. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants