IDE: better permission checking when opening a project.
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Mon, 23 May 2022 16:27:56 +0200
changeset 3492 cf6d6e033c86
parent 3490 4f252e8d6759
child 3493 ff25207ec303
IDE: better permission checking when opening a project.
util/misc.py
--- a/util/misc.py	Mon May 30 12:44:04 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