]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Bug #829532] Invoking os.makedirs() with an argument that contains a
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 23 Dec 2003 16:33:28 +0000 (16:33 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 23 Dec 2003 16:33:28 +0000 (16:33 +0000)
    directory name with a single dot fails.  The patch skips creating
    directories named os.curdir. (Patch by Bram Moolenaar)

2.3 bugfix candidate.

Lib/os.py

index 128351e290e3752b7643acb5fcdaf243ad5a04c9..8cec9125ad77d918c98aca0d399a3ac541db222b 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -152,6 +152,8 @@ def makedirs(name, mode=0777):
         head, tail = path.split(head)
     if head and tail and not path.exists(head):
         makedirs(head, mode)
+        if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
+            return
     mkdir(name, mode)
 
 def removedirs(name):