bpo-19930: The mode argument of os.makedirs() no longer affects the file (#799)

permission bits of newly-created intermediate-level directories.
This commit is contained in:
Serhiy Storchaka 2017-03-24 13:27:42 +02:00 committed by GitHub
parent 5619ab2db3
commit e304e33c16
5 changed files with 32 additions and 3 deletions

View file

@ -207,7 +207,7 @@ def makedirs(name, mode=0o777, exist_ok=False):
head, tail = path.split(head)
if head and tail and not path.exists(head):
try:
makedirs(head, mode, exist_ok)
makedirs(head, exist_ok=exist_ok)
except FileExistsError:
# Defeats race condition when another thread created the path
pass