#1142685 DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal

#1142685#5
Date:
2026-07-24 06:49:00 UTC
From:
To:
Dear Maintainer,

when running "apt-get update" after installing apt-transport-s3 and
configuring an S3 based repository, I see the following warning:

/usr/lib/apt/methods/s3:317: 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).
  amzdate = datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%SZ')

In order to avoid breaking the package when Python is updated, this should be fixed.

Best regards,

	Dirk Heinrichs