Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of deprecated datetime.utcnow() #2468

Merged
merged 9 commits into from
Jun 10, 2023
Merged

Replace uses of deprecated datetime.utcnow() #2468

merged 9 commits into from
Jun 10, 2023

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.

@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.

2 participants