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

Deprecated usage of utcfromtimestamp() in 3.x release stream #7545

Closed
1 task done
sethmlarson opened this issue Aug 21, 2023 · 2 comments
Closed
1 task done

Deprecated usage of utcfromtimestamp() in 3.x release stream #7545

sethmlarson opened this issue Aug 21, 2023 · 2 comments
Labels

Comments

@sethmlarson
Copy link

Describe the bug

Receiving the following deprecation when using the latest pre-release of Python 3.12. See: https://docs.python.org/3.12/library/datetime.html#datetime.datetime.utcfromtimestamp

To Reproduce

Import aiohttp on Python 3.12

Expected behavior

No DeprecationWarning

Logs/tracebacks

ImportError while loading conftest '/Users/runner/work/truststore/truststore/tests/conftest.py'.
tests/conftest.py:11: in <module>
    from aiohttp import web
.nox/test/lib/python3.12/site-packages/aiohttp/__init__.py:6: in <module>
    from .client import (
.nox/test/lib/python3.12/site-packages/aiohttp/client.py:73: in <module>
    from .cookiejar import CookieJar
.nox/test/lib/python3.12/site-packages/aiohttp/cookiejar.py:36: in <module>
    class CookieJar(AbstractCookieJar):
.nox/test/lib/python3.12/site-packages/aiohttp/cookiejar.py:57: in CookieJar
    MAX_32BIT_TIME = datetime.datetime.utcfromtimestamp(2**31 - 1)
E   DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).

Python Version

$ python --version
3.12.0rc1

aiohttp Version

$ python -m pip show aiohttp
Name: aiohttp
Version: 3.8.5
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: 
Author-email: 
License: Apache 2
Location: /home/sethmlarson/truststore/venv/lib/python3.11/site-packages
Requires: aiosignal, async-timeout, attrs, charset-normalizer, frozenlist, multidict, yarl
Required-by:

multidict Version

$ python -m pip show multidict
Name: multidict
Version: 6.0.4
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /home/sethmlarson/truststore/venv/lib/python3.11/site-packages
Requires: 
Required-by: aiohttp, yarl

yarl Version

$ python -m pip show yarl
Name: yarl
Version: 1.9.2
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache-2.0
Location: /home/sethmlarson/truststore/venv/lib/python3.11/site-packages
Requires: idna, multidict
Required-by: aiohttp

OS

Ubuntu 22.04

Related component

Server, Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@Dreamsorcerer
Copy link
Member

#7302

@sethmlarson
Copy link
Author

Ah, so this has been backported to 3.x but hasn't been released yet. Thank you!

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

No branches or pull requests

2 participants