##// END OF EJS Templates
Fix filenbmanager.list_dirs fails for Windows user profile directory
cgohlke -
Show More
@@ -102,10 +102,20 b" def is_hidden(abs_path, abs_root=''):"
102 102 if any(part.startswith('.') for part in inside_root.split(os.sep)):
103 103 return True
104 104
105 # check that path can be listed
106 try:
107 os.listdir(abs_path)
108 except Exception:
109 return True
110
105 111 # check UF_HIDDEN on any location up to root
106 112 path = abs_path
107 113 while path and path.startswith(abs_root) and path != abs_root:
114 try:
115 # may fail on Windows junctions
108 116 st = os.stat(path)
117 except Exception:
118 return True
109 119 if getattr(st, 'st_flags', 0) & UF_HIDDEN:
110 120 return True
111 121 path = os.path.dirname(path)
General Comments 0
You need to be logged in to leave comments. Login now