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-73991: Add `pathlib.Path.rmtree()` by barneygale · Pull Request #119060 · python/cpython

Conversation

@barneygale

@barneygale barneygale commented May 15, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Add a Path.rmtree() method that removes an entire directory tree, like shutil.rmtree(). The signature of the optional on_error argument matches the Path.walk() argument of the same name, but differs from the onexc and onerror arguments to shutil.rmtree(). Consistency within pathlib is probably more important.

In the private pathlib ABCs, we add an implementation based on walk().

  • Issue: Support moving across filesystems in pathlib.Path, as shutil.move() does #73991

📚 Documentation preview 📚: https://cpython-previews--119060.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

nineteendo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@barneygale
pythonGH-73991: Add pathlib.Path.rmtree()
bbcb1ce
Add a `Path.rmtree()` method that removes an entire directory tree using
`shutil.rmtree()`. The signature of the optional *on_error* argument
matches the `Path.walk()` argument of the same name, but differs from the
*onexc* and *onerror* arguments to `shutil.rmtree()`. Consistency within
pathlib is probably more important.

In the private pathlib ABCs, we add an implementation based on `walk()`.
@barneygale barneygale added the topic-pathlib label May 15, 2024
@bedevere-app bedevere-app Bot added the awaiting core review label May 15, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 15, 2024
Support moving across filesystems in pathlib.Path, as shutil.move() does #73991
Closed
barneygale added 7 commits May 15, 2024 01:53
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
94ef5c1
@barneygale
Use os.walk() and os.fwalk() rather than shutil.rmtree()
62f7eae
@barneygale
Undo shutil change
4c73a92
@barneygale
Line up implementations
98fa2e2
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
7819005
@barneygale
Tests
b504019
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
bdd1255
@barneygale
barneygale marked this pull request as draft June 14, 2024 20:09
@bedevere-app bedevere-app Bot removed the awaiting core review label Jun 14, 2024
barneygale added 6 commits June 18, 2024 22:42
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
5d2472e
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
eadbbe6
@barneygale
Use implementation from shutil
ab7b086
@barneygale
Fix some Windows tests.
f88fc12
@barneygale
More Windows test tweaks
5a0fc07
@barneygale
This is confusing :/
2559e6a
@barneygale
barneygale marked this pull request as ready for review June 19, 2024 00:42
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 19, 2024
barneygale added 5 commits June 24, 2024 18:52
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
5588e1f
@barneygale
WIP
bcff053
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
be00bfe
@barneygale
Fix docs
d8c4291
@barneygale
Minor tweaks
a9c8d4f
@barneygale
barneygale requested a review from zooba July 3, 2024 03:55
picnixz
picnixz reviewed Jul 3, 2024
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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.

Thank you for that addition by the way. Here are some nitpicking comments.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

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

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

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

Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

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

Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

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

Comment thread Lib/pathlib/_abc.py Resolved

Uh oh!

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

Comment thread Lib/pathlib/_abc.py Resolved

Uh oh!

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

Comment thread Lib/pathlib/_abc.py Resolved

Uh oh!

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

barneygale and others added 2 commits July 4, 2024 19:33
@barneygale @picnixz
Apply suggestions from code review
4bcc143
Co-authored-by: Bénédikt Tran <[email protected]>
@barneygale
Address review feedback.
ab0f447
@barneygale
Merge branch 'main' into pythongh-73991-rmtree
40ed5c8
@barneygale
barneygale enabled auto-merge (squash) July 20, 2024 17:48
@AA-Turner

AA-Turner commented Jul 20, 2024

Copy link
Copy Markdown
Member

Docs failure is #122068

barneygale reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@AA-Turner
Merge branch 'main' into pythongh-73991-rmtree
0cf0180
@barneygale
barneygale merged commit 094375b into python:main Jul 20, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@zooba zooba Awaiting requested review from zooba

Uh oh!

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

Assignees

No one assigned

Labels

topic-pathlib

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.

3 participants

@barneygale @AA-Turner @picnixz
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.