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 Charles Machalow
Recipients Charles Machalow
Date 2020-06-14.04:28:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592108904.89.0.703350475052.issue40972@roundup.psfhosted.org>
In-reply-to
Content
I think it would make sense to add a recurse flag to the Path.rmdir() method. It would default to False (to allow for current behavior). If set to True, the method would act very similarly to shutil.rmtree() in that it would delete all files in the directory and then delete the directory itself.

I understand that this behavior doesn't really line up with os.rmdir(), though I think it makes sense to allow this type of method to appear on the Path object for easy deletion of a directory with things still inside (while looking more object-oriented at the same time)

If people think this makes sense, I may be able to provide a PR to just delegate to shutil.rmtree for the recurse=True operation.

Thanks for thoughts.
History
Date User Action Args
2020-06-14 04:28:24Charles Machalowsetrecipients: + Charles Machalow
2020-06-14 04:28:24Charles Machalowsetmessageid: <1592108904.89.0.703350475052.issue40972@roundup.psfhosted.org>
2020-06-14 04:28:24Charles Machalowlinkissue40972 messages
2020-06-14 04:28:23Charles Machalowcreate