2
0
Эх сурвалжийг харах

locking (win32): deal with os.listdir PermissionErrors

due to unclear circumstances, windows sometimes just says "PermissionError" when trying to list a directory.
Thomas Waldmann 2 жил өмнө
parent
commit
7063c2abec
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      src/borg/locking.py

+ 2 - 0
src/borg/locking.py

@@ -191,6 +191,8 @@ class ExclusiveLock:
             names = os.listdir(self.path)
         except FileNotFoundError:  # another process did our job in the meantime.
             pass
+        except PermissionError:  # win32 might throw this.
+            return False
         else:
             for name in names:
                 try: