Skip to content

Conversation

@dgw
Copy link
Member

@dgw dgw commented Jun 8, 2023

Description

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.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • 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.)

@dgw dgw added Tweak Documentation Housekeeping Code cleanup, removal of deprecated stuff, etc. labels Jun 8, 2023
@dgw dgw added this to the 8.0.0 milestone Jun 8, 2023
@dgw dgw requested a review from a team June 8, 2023 18:32
@dgw dgw changed the title bot: replace use of deprecated datetime.utcnow() Replace uses of deprecated datetime.utcnow() Jun 8, 2023
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@SnoopJ SnoopJ force-pushed the rm-datetime.utcX branch from 904f1ec to ced222c Compare June 9, 2023 01:18
@dgw dgw merged commit a73a44f into master Jun 10, 2023
@dgw dgw deleted the rm-datetime.utcX branch June 10, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Housekeeping Code cleanup, removal of deprecated stuff, etc. Tweak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants