Message208654
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)
shutil.rmtree('path')
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:45 | paul.moore | set | recipients:
+ paul.moore, tim.golden, r.david.murray, zach.ware, ivan.radic |
2014-01-21 15:29:44 | paul.moore | set | messageid: <1390318184.98.0.281913775098.issue19643@psf.upfronthosting.co.za> |
2014-01-21 15:29:44 | paul.moore | link | issue19643 messages |
2014-01-21 15:29:44 | paul.moore | create | |
|