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 paul.moore
Recipients ivan.radic, paul.moore, r.david.murray, tim.golden, zach.ware
Date 2014-01-21.15:29:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It's similar. But the problem is that it only returns a list of errors, it doesn't let you address the error *while the rmtree is in progress*.

The key thing is that if you can fix the problem in onerror, you can avoid needing to restart the whole tree walk, which is the key aspect of rmtree.

As things stand, you can use the set_rw function I showed above, and run the rmtree twice:

    shutil.rmtree('path', onerror=set_rw)

The first run fixes the error and then the second one deletes the remaining files. But this is clearly inefficient, and makes the limitations of "report errors to the user who can then address them" fairly obvious.
Date User Action Args
2014-01-21 15:29:45paul.mooresetrecipients: + paul.moore, tim.golden, r.david.murray, zach.ware, ivan.radic
2014-01-21 15:29:44paul.mooresetmessageid: <>
2014-01-21 15:29:44paul.moorelinkissue19643 messages
2014-01-21 15:29:44paul.moorecreate