As makedirs() is implemented it sounds reasonable to also implement the related removedirs() function. rmtree() seems to be in place as an alternative but if I'm not mistaken the result is slightly different.
Thanks for your report!
For reference, here are the relevant sections from the documentation:
It looks to me that
removedirscan be implemented by calling
rmtreeon the top-level directory with
ignore_errors=True. Do you agree?
This doesn't add the functionality of accepting path-like objects though. This is the subject of ticket #119.
Thanks for adding the relevant links, I should have done that myself...
I'm no expert on python or in those functions but judging from the documentation I would assume that
rmtreediffers in the following way:
- It also removes non-empty folders
- It tries to remove the whole path and not partially some sub directories.
- Exceptions were different and thrown in different cases I believe
I can be wrong in some or all points but that needs to be checked :)
Thanks for your great work!