From aa6a77285d7173c13c01ca12636a47dff919d1da Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Tue, 19 Nov 2019 00:17:27 -0800 Subject: [PATCH] makedirs: add comment on why do have to use umask --- dvc/utils/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dvc/utils/__init__.py b/dvc/utils/__init__.py index 350a6c3bc9..a7e9ab5f42 100644 --- a/dvc/utils/__init__.py +++ b/dvc/utils/__init__.py @@ -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)