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
95 stars 12 forks source link

Fix deprecationwarning for datetime.utcnow #144

Open Matthieu-LAURENT39 opened 9 months ago

Matthieu-LAURENT39 commented 9 months ago

This replaces the call to datetime.utcnow() to datetime.now(timezone.utc). datetime.utcnow() is deprecated since python 3.12, and as such shows a warning every time save_to_storage() is called.

We use timezone.utc instead of the more recent datetime.utc, since only the former is available in python 3.7

yobuntu commented 7 months ago

should fix : https://github.com/jowilf/sqlalchemy-file/issues/150