mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
[Bug #829532] Invoking os.makedirs() with an argument that contains a
directory name with a single dot fails. The patch skips creating
directories named os.curdir. (Patch by Bram Moolenaar)
2.3 bugfix candidate.
This commit is contained in:
parent
7fc4cf57b8
commit
6fccc8a9ec
1 changed files with 2 additions and 0 deletions
|
|
@ -152,6 +152,8 @@ def makedirs(name, mode=0777):
|
||||||
head, tail = path.split(head)
|
head, tail = path.split(head)
|
||||||
if head and tail and not path.exists(head):
|
if head and tail and not path.exists(head):
|
||||||
makedirs(head, mode)
|
makedirs(head, mode)
|
||||||
|
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
|
||||||
|
return
|
||||||
mkdir(name, mode)
|
mkdir(name, mode)
|
||||||
|
|
||||||
def removedirs(name):
|
def removedirs(name):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue