Bugs item #1149804, was opened at 2005-02-23 13:26 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1149804&group_id=5470
Category: Macintosh Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jurjen N.E. Bos (jneb) Assigned to: Jack Jansen (jackjansen) Summary: macostools.mkdirs: not thread-safe Initial Comment: 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 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1149804&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com