Message104117
The code that lists directory contents in rmtree is:
try:
names = os.listdir(path)
except os.error, err:
onerror(os.listdir, path, sys.exc_info())
If there is an error there is nothing the "onerror" function can do to fix the problem because the variable "names" will not be updated after the problem is solved in "onerror".
Two possible solutions:
1 - Call os.listdir() again after onerror()
try:
names = os.listdir(path)
except os.error, err:
onerror(os.listdir, path, sys.exc_info())
names = os.listdir(path)
2 - Allow onerror() to return a value and set "names" to that value.
try:
names = os.listdir(path)
except os.error, err:
names = onerror(os.listdir, path, sys.exc_info()) |
|
Date |
User |
Action |
Args |
2010-04-24 18:57:43 | rubenlm | set | recipients:
+ rubenlm |
2010-04-24 18:57:43 | rubenlm | set | messageid: <1272135463.46.0.698266589767.issue8523@psf.upfronthosting.co.za> |
2010-04-24 18:57:42 | rubenlm | link | issue8523 messages |
2010-04-24 18:57:41 | rubenlm | create | |
|