mpdavis / python-jose

A JOSE implementation in Python
MIT License
1.54k stars 235 forks source link

Deprecation warning from python 3.12 #334

Open spapanik opened 1 year ago

spapanik commented 1 year ago

python 3.12 deprecated the use of .utcnow(), and therefore there are deprecation warnings when creating JWTs:

<...?/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).

Jamim commented 9 months ago

For the sake of transparency, this issue affects FastAPI's test suite: