From 7063c2abeccefb79455b1bc035edcb69fcb212d0 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 13 Jan 2023 20:48:50 +0100 Subject: [PATCH] locking (win32): deal with os.listdir PermissionErrors due to unclear circumstances, windows sometimes just says "PermissionError" when trying to list a directory. --- src/borg/locking.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/borg/locking.py b/src/borg/locking.py index a98d7b1e2..efb9e997b 100644 --- a/src/borg/locking.py +++ b/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: