Skip to content

Conversation

@barneygale
Copy link
Contributor

@barneygalebarneygale commented May 15, 2024

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().


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

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()`.
@barneygalebarneygale marked this pull request as draft June 14, 2024 20:09
@barneygalebarneygale marked this pull request as ready for review June 19, 2024 00:42
@barneygalebarneygale requested a review from zoobaJuly 3, 2024 03:55
Copy link
Member

@picnixzpicnixz left a 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.

barneygaleand others added 2 commits July 4, 2024 19:33
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@barneygalebarneygale enabled auto-merge (squash) July 20, 2024 17:48
@AA-Turner
Copy link
Member

Docs failure is #122068

@barneygalebarneygale merged commit 094375b into python:mainJul 20, 2024
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.

3 participants

@barneygale@AA-Turner@picnixz