Skip to content

Conversation

@iritkatriel
Copy link
Member

@iritkatrieliritkatriel commented Mar 20, 2023

I've asked on discord and was told that we normally emit the deprecation warning as soon as something is deprecated.

Lib/shutil.py Outdated
"""

ifonerrorisnotNone:
warnings.warn("onerror is deprecated, use onexc instead",
Copy link
Contributor

@giampaologiampaoloMar 20, 2023

Choose a reason for hiding this comment

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

I would rephrase this as "onerror argument is deprecated, use onexc instead" (emphasys on the fact that onerror is an argument)

@iritkatrieliritkatriel merged commit 7f760c2 into python:mainMar 21, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@iritkatrieliritkatriel deleted the deprecationwarning branch April 3, 2023 17:42
"""

ifonerrorisnotNone:
warnings.warn("onerror argument is deprecated, use onexc instead",

Choose a reason for hiding this comment

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

The warn call needs stacklevel=2 parameter so that the warning message shows what is making the deprecated call. Werkzeug's tests started failing on the latest 3.12 alpha because of this, and it's really hard to tell what's causing it (I think it's pytest) because the warning just points at this line right now instead of the caller.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Thanks, will fix.

iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Apr 10, 2023
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@iritkatriel@giampaolo@davidism@bedevere-bot