jowilf / sqlalchemy-file

SQLAlchemy-file is a SQLAlchemy extension for attaching files to SQLAlchemy model and uploading them to various storage such as Local Storage, Amazon S3, Rackspace CloudFiles, Google Storage and others using Apache Libcloud.
https://jowilf.github.io/sqlalchemy-file/
MIT License
82 stars 11 forks source link

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

Open yobuntu opened 2 months ago

yobuntu commented 2 months ago

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.