minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
851 stars 325 forks source link

“datetime.datetime.utcnow() is deprecated” on Python 3.12 #1374

Closed adamchainz closed 11 months ago

adamchainz commented 11 months ago

I’m seeing this deprecation warning in my test suite with Python 3.12:

/.../minio/time.py:105: 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).
  return datetime.utcnow().replace(tzinfo=timezone.utc)

Deprecation release notes

adamchainz commented 11 months ago

Looks like this has been handled in 5ca66533ece627c8e4452180260a9a38de6f25aa, awaiting release.

balamurugana commented 11 months ago

Fixed by https://github.com/minio/minio-py/pull/1338