Author gvanrossum
Recipients
Date 2004-10-27.15:56:40
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6380

- I don't like the nested function -- Python's function call
overhead is significant and I worry about that when deleting
massive trees. (I want to be able to "rm -rf /*"
efficiently. :-)

- The err instance instead of sys.exc_info() was an
oversight. The docstring repeats this mistake.

- I don't think the lstat() call is unclean, and again I
prefer performance.

- Here's an additional trick to reduce the code duplication
(see upload rmtree-ng.py):

At the top of the function put:

if ignore_errors:
....def onerror(*args): pass
elif onerror is None:
....def onerror(*args): raise

Then all the except blocks can be collapsed to just the
onerror() call. (I care less about the performance in case
there's an error.)
History
Date User Action Args
2007-08-23 14:26:48adminlinkissue1048941 messages
2007-08-23 14:26:48admincreate