Skip to content

Commit

Permalink
makedirs: add comment on why do have to use umask
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein committed Nov 19, 2019
1 parent ecfbc3a commit aa6a772
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dvc/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa6a772

Please sign in to comment.