-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-120784: Reword utcnow/utcfromtimestamp deprecation warning to use datetime.timezone.utc #120791
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
Conversation
|
I think I am -0 on this change. I chose the I would not think that we should be so concerned with backwards compatibility, since this deprecation warning only even happens in Python 3.12+, and it's referring to a removal that won't take place for an indefinite amount of time in the future. Evidently some people are indeed confused by this, though, so I dunno, maybe it's better on net to recommend the wordy version? 🤷 |
pganssle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned, I'm not really in favor of merging this, but if we do end up merging it, it should probably get a news blurb.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Ruff also mentions
Would you prefer to mention both too? |
|
pganssle, I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @pganssle: please review the changes made to this pull request. |
|
I agree with Paul, the warning is not wrong and this is not really a bug. |
It's better to point to
datetime.timezone.utcasdatetime.UTCwas only added in Python 3.11.No need to suggest to make code backwards incompatible without a good reason.