]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for issue 1149804
authorRonald Oussoren <ronaldoussoren@mac.com>
Fri, 2 Jan 2009 15:00:05 +0000 (15:00 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Fri, 2 Jan 2009 15:00:05 +0000 (15:00 +0000)
Lib/plat-mac/macostools.py
Misc/NEWS

index d7724fa271b58d2a3cd897d67895142e77bbe407..337cc7f1f1d46c5d5693d160de2d5b358e7a8085 100644 (file)
@@ -62,7 +62,14 @@ def mkdirs(dst):
     if os.sep == ':' and not ':' in head:
         head = head + ':'
     mkdirs(head)
-    os.mkdir(dst, 0777)
+
+    try:
+        os.mkdir(dst, 0777)
+    except OSError, e:
+        # be happy if someone already created the path
+        if e.errno != errno.EEXIST:
+            raise
+
 
 def touched(dst):
     """Tell the finder a file has changed. No-op on MacOSX."""
index 03cc72713faa9a3de606515b87f7e455200332b9..040ed5c3b3b6cec8204828c3e95016ce59e6c34e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -235,6 +235,9 @@ Library
 - Issue #1737832 : plat-mac/EasyDialog.py no longer uses the broken aepack
   module.
 
+- Issue #1149804: macostools.mkdirs now even works when another process
+  creates one of the needed subdirectories.
+
 Tools/Demos
 -----------