FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-73991: Add `pathlib.Path.rmtree()` by barneygale · Pull Request #119060 · python/cpython · GitHub

/ cpython Public

GH-73991: Add pathlib.Path.rmtree() - #119060

Merged
barneygale merged 23 commits into
python:mainfrom
barneygale:gh-73991-rmtree
Jul 20, 2024
Merged

GH-73991: Add pathlib.Path.rmtree()#119060
barneygale merged 23 commits into
python:mainfrom
barneygale:gh-73991-rmtree

Conversation

barneygale commented May 15, 2024
edited
Loading

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


📚 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()`.
barneygale marked this pull request as draft June 14, 2024 20:09
barneygale marked this pull request as ready for review June 19, 2024 00:42
barneygale requested a review from zooba July 3, 2024 03:55

picnixz 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Comment thread Doc/library/pathlib.rst Outdated
Comment thread Doc/library/pathlib.rst Outdated
Comment thread Doc/library/pathlib.rst Outdated
Comment thread Doc/library/pathlib.rst Outdated
Comment thread Doc/library/pathlib.rst Outdated
Comment thread Doc/whatsnew/3.14.rst Outdated
Comment thread Doc/library/pathlib.rst Outdated
Comment thread Lib/pathlib/_abc.py
Comment thread Lib/pathlib/_abc.py Outdated
Comment thread Lib/pathlib/_abc.py
barneygale and others added 2 commits July 4, 2024 19:33
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
barneygale enabled auto-merge (squash) July 20, 2024 17:48

Copy link
Copy Markdown
Member

Docs failure is #122068

barneygale merged commit 094375b into python:main Jul 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to 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


Back | FazBrowse Home | New Git URL