rubenlm <ru...@libhertz.com> added the comment:

Do you really need the global status? I wrote an onerror that seems to works 
fine after I modified rmtree with the "return" suggested by r.david.murray. It 
assumes that: 

if os.listdir fails: the user doesn't have read permissions in the dir;
if os.remove or os.rmdir fails: the user doesn't have write permissions in the 
dir that contains the file/dir being removed.

There are other reasons it can fail (attributes, acl, readonly filesystem, ...) 
but having access to the global status doesn't seem to be of much help anyway.

I don't like your fix 2/ because it can fail to copy files if you don't have 
read permissions for the file but have write permissions in the directory (so 
you can delete the file). Besides, the behaviour doesn't seem useful.

/1 seems ok to me but to make use of the global status it provides the user 
must write a somewhat complex recovery code.

All in all it seems the current behaviour of having an onerror function is more 
user friendly.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8523>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to