Tarek Ziadé <ziade.ta...@gmail.com> added the comment:

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

The onerror() code you did is as complex as a global function working with a 
sequence returned by rmtree, since it is used *everywhere* in rmtree, and not 
only for os.listdir issues. IOW, if you didn't handle other possible failures 
than os.listdir errors, it will fail if rmtree calls it for other APIs like 
os.remove, etc..

If we state that onerror() is not used as a fallback in rmtree(), and do 
whatever it wants to do on its side, in an isolated manner, then I find it 
simpler that this function works will a list of paths rmtree() failed to 
removed, at the end of the rmtree() process. 

I'd be curious to see your onerror() function btw: if it's here just to silent 
permission errors, 1/ would make it even simpler: don't deal with the error 
list returned by rmtree() that's all.

----------

_______________________________________
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