makedirs: add comment on why do have to use umask

This commit is contained in:
Ivan Shcheklein
2019-11-19 00:17:27 -08:00
parent ecfbc3a6de
commit aa6a77285d
+3
View File
@@ -152,6 +152,9 @@ def makedirs(path, exist_ok=False, mode=None):
_makedirs(path, exist_ok=exist_ok)
return
# utilize umask to set proper permissions since Python 3.7 the `mode`
# `makedirs` argument no longer affects the file permission bits of
# newly-created intermediate-level directories.
umask = os.umask(0o777 - mode)
try:
_makedirs(path, exist_ok=exist_ok)