Merge pull request #134 from YunoHost/fix-774-filesystem-chmod-recursive-mode

[fix] Recursive chmod was broken
This commit is contained in:
Laurent Peuch 2017-02-14 22:27:58 +01:00 committed by GitHub
commit 4506054238
2 changed files with 3 additions and 3 deletions

View file

@ -101,9 +101,9 @@ def chmod(path, mode, fmode=None, recursive=False):
fmode = mode
for root, dirs, files in os.walk(path):
for d in dirs:
os.chmod(path, mode)
os.chmod(os.path.join(root, d), mode)
for f in files:
os.chmod(path, fmode)
os.chmod(os.path.join(root, f), fmode)
def rm(path, recursive=False, force=False):

View file

@ -8,9 +8,9 @@ try:
from pipes import quote # Python2 & Python3 <= 3.2
except ImportError:
from shlex import quote # Python3 >= 3.3
quote # This line is here to avoid W0611 PEP8 error (see comments above)
from .stream import async_file_reading
quote # This line is here to avoid W0611 PEP8 error (see comments above)
# Prevent to import subprocess only for common classes
CalledProcessError = subprocess.CalledProcessError