GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-102828: emit deprecation warning for onerror arg to shutil.rmtree by iritkatriel · Pull Request #102850 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Mar 20, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

  • Issue: add option for error callback of to shutil.rmtree to accept exception rather than exc_info #102828

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iritkatriel
pythongh-102828: add deprecation warning for onerror arg to shutil.rm…
ef0e4cd
…tree
@iritkatriel
iritkatriel requested a review from giampaolo March 20, 2023 19:04
@bedevere-bot bedevere-bot mentioned this pull request Mar 20, 2023
add option for error callback of to shutil.rmtree to accept exception rather than exc_info #102828
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Mar 20, 2023
@iritkatriel iritkatriel added the skip news label Mar 20, 2023
giampaolo
giampaolo reviewed Mar 20, 2023
View reviewed changes
Comment thread Lib/shutil.py Outdated
"""

if onerror is not None:
warnings.warn("onerror is deprecated, use onexc instead",

@giampaolo giampaolo Mar 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
iritkatriel
iritkatriel commented Mar 20, 2023
View reviewed changes
Comment thread Lib/shutil.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel and others added 2 commits March 20, 2023 23:10
@iritkatriel
reword msg
6724776
@iritkatriel
migrate tempfile to onexc
bd3bc21
@iritkatriel
iritkatriel merged commit 7f760c2 into python:main Mar 21, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Mar 21, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@iritkatriel @Fidget-Spinner
pythongh-102828: emit deprecation warning for onerror arg to shutil.r…
6776fb1
…mtree (python#102850)
@iritkatriel
iritkatriel deleted the deprecationwarning branch April 3, 2023 17:42
davidism
davidism reviewed Apr 10, 2023
View reviewed changes
Comment thread Lib/shutil.py
"""

if onerror is not None:
warnings.warn("onerror argument is deprecated, use onexc instead",

@davidism davidism Apr 10, 2023

Copy link
Copy Markdown

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iritkatriel iritkatriel Apr 10, 2023

Copy link
Copy Markdown
Member Author

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.

Thanks, will fix.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Apr 10, 2023
@iritkatriel
pythongh-102850: set stacklevel on deprecation warning
6a4bfb5
@iritkatriel iritkatriel mentioned this pull request Apr 10, 2023
gh-102828: set stacklevel on deprecation warning #103422
Merged
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@iritkatriel @warsaw
pythongh-102828: emit deprecation warning for onerror arg to shutil.r…
033e424
…mtree (python#102850)
@coderabbitai coderabbitai Bot mentioned this pull request Sep 12, 2026
ci+test(viz): hermetic viz gate on a frozen corpus; data-gated interaction pins robbe1912/neuronav#166
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@giampaolo giampaolo giampaolo left review comments
+1 more reviewer
@davidism davidism davidism left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@iritkatriel @giampaolo @davidism @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.