Message60677
Here is an easily fixable semi-bug in macostools:
When two threads are creating the same directory structure, one
of them will fail as soon as the other thread made a directory.
This is trivially fixable by ignoring the error, but I'm not sure if it is
worth it, like this:
def mkdirs(dst):
"""Make directories leading to 'dst' if they don't exist yet"""
if dst == '' or os.path.exists(dst):
return
head, tail = os.path.split(dst)
if os.sep == ':' and not ':' in head:
head = head + ':'
mkdirs(head)
try: os.mkdir(dst, 0777)
except OSError, err:
if err.errno==17: #file exists
#someone else has created the directory in the
meantime. That's fine with me!
pass
else: raise
- Jurjen |
|
Date |
User |
Action |
Args |
2008-01-20 09:57:34 | admin | link | issue1149804 messages |
2008-01-20 09:57:34 | admin | create | |
|