Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
neutrinoceros:datetime_utcfromtimestamp_depr_msg
Aug 27, 2023
Merged

clarify distinction between datetime module and class in deprecation messages#108073
serhiy-storchaka merged 1 commit into
python:mainfrom
neutrinoceros:datetime_utcfromtimestamp_depr_msg

Conversation

@neutrinoceros

Copy link
Copy Markdown
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).

@neutrinocerosneutrinoceros changed the title gh-NNNN: clarify distinction between datetime module and class in deprecation messagegh-108073: clarify distinction between datetime module and class in deprecation messageAug 17, 2023
@neutrinocerosneutrinoceros changed the title gh-108073: clarify distinction between datetime module and class in deprecation messageclarify distinction between datetime module and class in deprecation messageAug 17, 2023
@neutrinoceros
neutrinoceros marked this pull request as ready for review August 17, 2023 09:00
serhiy-storchaka
serhiy-storchaka previously approved these changes Aug 17, 2023

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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
neutrinocerosforce-pushed the datetime_utcfromtimestamp_depr_msg branch from e0570a5 to 29c0fadCompareAugust 17, 2023 09:54
@neutrinoceros

Copy link
Copy Markdown
ContributorAuthor

@serhiy-storchaka done !

@neutrinocerosneutrinoceros changed the title clarify distinction between datetime module and class in deprecation messageclarify distinction between datetime module and class in deprecation messagesAug 17, 2023
@neutrinoceros

Copy link
Copy Markdown
ContributorAuthor

Ping @Yhg1s for merge ?

@serhiy-storchaka
serhiy-storchaka merged commit 09343db into python:mainAug 27, 2023
@miss-islington

Copy link
Copy Markdown
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
Copy Markdown

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 <cr52@protonmail.com>
@bedevere-botbedevere-bot removed the needs backport to 3.12 only 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 <cr52@protonmail.com>
@ellert

Copy link
Copy Markdown

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 freeto 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

@neutrinoceros@miss-islington@bedevere-bot@ellert@serhiy-storchaka