cpython
cpython copied to clipboard
GH-73991: Add `pathlib.Path.rmtree()`
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: gh-73991
📚 Documentation preview 📚: https://cpython-previews--119060.org.readthedocs.build/