As @SnoopJ mentioned on IRC right after opening #2457, datetime.utcnow() is deprecated in Python 3.12 (and also datetime.utcfromtimestamp()). The recommended replacements for those items have been usable for most of Python 3's history—though we don't get to usedatetime.UTC instead of datetime.timezone.utc until Python 3.11 is our minimum version.
[x] I can and do license this contribution under the EFLv2
[x] No issues are reported by make qa (runs make quality and make test)
[x] I have tested the functionality of the things this change touches
Notes
As often happens when I poke at stuff, there are some minor documentation corrections lumped in here that I didn't think warranted (a) separate PR(s).
I wanted to go further with this and get rid of pytz, but zoneinfo isn't available until Python 3.9. (There is a backports.zoneinfo package, but it hasn't been updated in a while and its issue tracker is starting to fill with reports of errors & warnings.)
Description
As @SnoopJ mentioned on IRC right after opening #2457,
datetime.utcnow()
is deprecated in Python 3.12 (and alsodatetime.utcfromtimestamp()
). The recommended replacements for those items have been usable for most of Python 3's history—though we don't get to usedatetime.UTC
instead ofdatetime.timezone.utc
until Python 3.11 is our minimum version.Checklist
make qa
(runsmake quality
andmake test
)Notes
As often happens when I poke at stuff, there are some minor documentation corrections lumped in here that I didn't think warranted (a) separate PR(s).
I wanted to go further with this and get rid of
pytz
, butzoneinfo
isn't available until Python 3.9. (There is abackports.zoneinfo
package, but it hasn't been updated in a while and its issue tracker is starting to fill with reports of errors & warnings.)