IDE: better permission checking when opening a project.
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Mon, 23 May 2022 16:27:56 +0200
changeset 3475 ee665dca07fa
parent 3469 97622e9560b5
child 3476 46a7aac382ef
IDE: better permission checking when opening a project.
util/misc.py
--- a/util/misc.py	Fri May 06 11:04:17 2022 +0200
+++ b/util/misc.py	Mon May 23 16:27:56 2022 +0200
@@ -42,8 +42,10 @@
     for root, dirs, files in os.walk(path):
         files = [f for f in files if not f[0] == '.']
         dirs[:] = [d for d in dirs if not d[0] == '.']
-        for name in files:
-            if os.access(root, os.W_OK) is not True or os.access(os.path.join(root, name), os.W_OK) is not True:
+        if os.access(root, os.W_OK) is not True:
+            return False
+        for name in dirs + files:
+            if os.access(os.path.join(root, name), os.W_OK) is not True:
                 return False
     return True