This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Aaron Hall
Recipients Aaron Hall
Date 2018-05-14.14:30:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526308235.34.0.682650639539.issue33498@psf.upfronthosting.co.za>
In-reply-to
Content
pathlib.Path wants the rmtree method from shutil

I think we need this method for a couple of reasons.

1. in shell, rm has the -r flag - In Python, we use shutil.rmtree as a best practice for this.

2. I prefer to teach my students about pathlib.Path as opposed to other ways of dealing with files. It's a great abstraction. But it's somewhat leaky, especially when it comes to recursively deleting a directory with its contents, as I now need to import rmtree from shutil.

Perhaps we need this as a method in the abstract base class that recursively uses the methods provided by the concrete implementations. I can look at the rmtree method for a reference implementation. 

Perhaps we should just give Path.rmdir a default recursive argument? Default would be False, of course, to retain current behavior.
History
Date User Action Args
2018-05-14 14:30:35Aaron Hallsetrecipients: + Aaron Hall
2018-05-14 14:30:35Aaron Hallsetmessageid: <1526308235.34.0.682650639539.issue33498@psf.upfronthosting.co.za>
2018-05-14 14:30:35Aaron Halllinkissue33498 messages
2018-05-14 14:30:35Aaron Hallcreate