Message22755
I just realized that the error handling in
shutil.rmtree has been broken ever since Python 2.3,
and the new implementation in 2.4 inherits this bug.
The problem is that the try/except is outside the for
loop, so that when an error is found, if either
ignore_errors or onerror is set, the desired action is
taken *once* but then the function returns rather than
trying to remove more files (ignoring or reporting
subsequent errors) as it should.
The sad thing is that the original code by David Ascher
(shutil.py rev 1.8) was correct! The bug was introduced
in rev 1.27, which claimed to make the implementation
agree with the docs. :-(
I'm giving this a high priority, hoping that it will be
fixed in 2.4b2 (and hopefully backported to 2.3). |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:26:48 | admin | link | issue1048941 messages |
| 2007-08-23 14:26:48 | admin | create | |
|