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

clarify distinction between datetime module and class in deprecation messages #108073

Merged

Conversation

neutrinoceros
Copy link
Contributor

I noticed this deprecation warning used datetime to refer to the module and the class on the same line (UTC is a module level constant while fromtimestamp is a class method).

@neutrinoceros neutrinoceros changed the title gh-NNNN: clarify distinction between datetime module and class in deprecation message gh-108073: clarify distinction between datetime module and class in deprecation message Aug 17, 2023
@neutrinoceros neutrinoceros changed the title gh-108073: clarify distinction between datetime module and class in deprecation message clarify distinction between datetime module and class in deprecation message Aug 17, 2023
@neutrinoceros neutrinoceros marked this pull request as ready for review August 17, 2023 09:00
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Could you please fix also datetime.utcnow()?

@neutrinoceros neutrinoceros force-pushed the datetime_utcfromtimestamp_depr_msg branch from e0570a5 to 29c0fad Compare August 17, 2023 09:54
@neutrinoceros
Copy link
Contributor Author

@serhiy-storchaka done !

@neutrinoceros neutrinoceros changed the title clarify distinction between datetime module and class in deprecation message clarify distinction between datetime module and class in deprecation messages Aug 17, 2023
@neutrinoceros
Copy link
Contributor Author

Ping @Yhg1s for merge ?

@serhiy-storchaka serhiy-storchaka merged commit 09343db into python:main Aug 27, 2023
@miss-islington
Copy link
Contributor

Thanks @neutrinoceros for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-108540 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2023
…messages (pythonGH-108073)

(cherry picked from commit 09343db)

Co-authored-by: Clément Robert <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Aug 27, 2023
@neutrinoceros neutrinoceros deleted the datetime_utcfromtimestamp_depr_msg branch August 27, 2023 13:34
Yhg1s pushed a commit that referenced this pull request Aug 27, 2023
…cation messages (GH-108073) (#108540)

Clarify distinction between datetime module and class in deprecation messages (GH-108073)
(cherry picked from commit 09343db)

Co-authored-by: Clément Robert <[email protected]>
@ellert
Copy link

ellert commented Sep 7, 2023

Lib/_pydatetime.py says:

warnings.warn("datetime.utcnow() is deprecated and scheduled for ....

Modules/_datetimemodule.c says:

if (PyErr_WarnEx(PyExc_DeprecationWarning,
    "datetime.datetime.utcnow() is deprecated and scheduled for ...

and similar for utcfromtimestamp. Inconsistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants