Message22769
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.) |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:26:48 | admin | link | issue1048941 messages |
| 2007-08-23 14:26:48 | admin | create | |
|