utils: makedirs: ignore chmod errors (#5570)

Same as with `protect()`, these errors might happen if fs is immutable
or doesn't support chmod()-ing. We can safely ignore these.

Fixes #5552
This commit is contained in:
Ruslan Kuprieiev
2021-03-08 16:28:02 +02:00
committed by GitHub
parent 47bcb02ef1
commit 70c445d1ee
+4 -1
View File
@@ -180,7 +180,10 @@ def makedirs(path, exist_ok=False, mode=None):
if not exist_ok or not os.path.isdir(path):
raise
os.chmod(path, mode)
try:
os.chmod(path, mode)
except OSError:
logger.trace("failed to chmod '%o' '%s'", mode, path, exc_info=True)
def copyfile(src, dest, no_progress_bar=False, name=None):