Message25573
Logged In: YES
user_id=432579
I'm fine with fixing the design for 2.5 and ignoring the bug for 2.4, since
programs susceptible to the bug must use some kind of work-around in
2.4.x (x < 2) anyway.
What I am using right now is:
def makedirs(name, mode=0777):
try:
os.mkdir(name, mode)
return
except OSError, err:
if err.errno == errno.EEXIST:
return
if err.errno != errno.ENOENT:
raise
makedirs(os.path.dirname(name), mode)
makedirs(name, mode)
This is compact and elegant, but relies on mkdir producing the correct
errno values, which should be true for all platforms I'm aware of. It could
also theoretically loop infinitely in bizarre cases but I don't see how that
ever could happen.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:32:31 | admin | link | issue1223238 messages |
2007-08-23 14:32:31 | admin | create | |
|