# HG changeset patch
# User Edouard Tisserant <edouard.tisserant@gmail.com>
# Date 1653316076 -7200
# Node ID cf6d6e033c86733a2f1d6099ca1285a96eddf739
# Parent  4f252e8d67595d73480267184ddd95cc698dc32b
IDE: better permission checking when opening a project.

diff -r 4f252e8d6759 -r cf6d6e033c86 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