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 tarek
Recipients r.david.murray, rubenlm, tarek
Date 2010-04-29.08:26:10
SpamBayes Score 2.9022181e-05
Marked as misclassified No
Message-id <1272529573.7.0.929599477952.issue8523@psf.upfronthosting.co.za>
In-reply-to
Content
The whole error handling in rmtree strikes me as something that cannot be used efficiently. (see also #7969).

How can you decide in an isolated function, that can be called anywhere in the tree you want to remove, the proper thing to do ? You don't know the global status of what is going on. 

I think rmtree() should drop these onerror calls and have two different behaviors:

1/ remove all it can in the tree, and return a list of files it couldn't remove, with the error for each file. The developer can then act upon.

2/ analyze the tree to see if the full removal can be done. If it's possible, it does it, if not, it doesn't do anything and return the problems.


For 2/ a possible way to do it could be to copy in a temporary place files that are being removed and copy them back in place in case a problem occurs. This can be long and space consuming though, for big files and big trees. I am not 100% sure 2/ is really useful though...
History
Date User Action Args
2010-04-29 08:26:14tareksetrecipients: + tarek, r.david.murray, rubenlm
2010-04-29 08:26:13tareksetmessageid: <1272529573.7.0.929599477952.issue8523@psf.upfronthosting.co.za>
2010-04-29 08:26:11tareklinkissue8523 messages
2010-04-29 08:26:10tarekcreate