python-jose
python-jose copied to clipboard
Resolve deprecation warnings related to datetime.utcnow in python 3.12
When upgrading my project to python 3.12, I started seeing deprecation warnings related to the use of datetime.datetime.utcnow.
/Users/br/.../lib/python3.12/site-packages/jose/jwt.py:311: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
now = timegm(datetime.utcnow().utctimetuple())
This PR simply implements the suggestion (in a backwards-compatible fashion), to get rid of these warnings in all projects depending on python-jose.
Regards
Fixes #334
Thanks @Jamim! Good call indeed
will this be bundled into release 3.4 or just a minor update?
Hello @phifuh,
will this be bundled into release 3.4 or just a minor update?
Sorry, but it looks like chances of this happening are near zero.
- #332
- #340
Best regards!
@Jamim thats fair, eventually someone might fork this project and actively maintain it, at least thats what I hope
@Jamim @phifuh I agree that there is a slim chance to get this change done, so I'm forking this, and I plan to create a successor for it. But, it seems like a lot of work to maintain multiple different backends, so I will keep cryptography and drop the rest.
guess it makes more sense to migrate to https://github.com/jpadilla/pyjwt