Uh oh!
There was an error while loading. Please reload this page.
GH-73991: Add pathlib.Path.rmtree() - #119060
Conversation
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()`.
picnixz
left a comment
There was a problem hiding this comment.
Thank you for that addition by the way. Here are some nitpicking comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
AA-Turner
commented
Jul 20, 2024
Docs failure is #122068 |
Add a
Path.rmtree()method that removes an entire directory tree, likeshutil.rmtree(). The signature of the optional on_error argument matches thePath.walk()argument of the same name, but differs from the onexc and onerror arguments toshutil.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/