This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jneb
Recipients
Date 2005-02-23.13:26:43
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2008-01-20 09:57:34adminlinkissue1149804 messages
2008-01-20 09:57:34admincreate