sqlalchemy-file icon indicating copy to clipboard operation
sqlalchemy-file copied to clipboard

datetime.datetime.utcnow() is deprecated from python 3.12

Open yobuntu opened this issue 1 year ago • 0 comments

When using python 3.12 we trigger this warning

sqlalchemy_file/file.py:124: 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).
    self["uploaded_at"] = datetime.utcnow().isoformat()

This seems not to be a big deal, and easy to fix as the replacement code is provided in the warning itself.

yobuntu avatar May 03 '24 09:05 yobuntu