浏览代码

Swallow temporary directory removal errors (#261).

Dan Helfman 8 月之前
父节点
当前提交
324dbc3a79
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      borgmatic/config/paths.py

+ 7 - 1
borgmatic/config/paths.py

@@ -128,7 +128,13 @@ class Runtime_directory:
         Delete any temporary directory that was created as part of initialization.
         Delete any temporary directory that was created as part of initialization.
         '''
         '''
         if self.temporary_directory:
         if self.temporary_directory:
-            self.temporary_directory.cleanup()
+            try:
+                self.temporary_directory.cleanup()
+            # The cleanup() call errors if, for instance, there's still a
+            # mounted filesystem within the temporary directory. There's
+            # nothing we can do about that here, so swallow the error.
+            except OSError:
+                pass
 
 
 
 
 def make_runtime_directory_glob(borgmatic_runtime_directory):
 def make_runtime_directory_glob(borgmatic_runtime_directory):