From 324dbc3a79429f4719d7b8f35a72fa59149c82fb Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 22 Nov 2024 10:56:07 -0800 Subject: [PATCH] Swallow temporary directory removal errors (#261). --- borgmatic/config/paths.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/borgmatic/config/paths.py b/borgmatic/config/paths.py index ad906d53..e5dfd7f1 100644 --- a/borgmatic/config/paths.py +++ b/borgmatic/config/paths.py @@ -128,7 +128,13 @@ class Runtime_directory: Delete any temporary directory that was created as part of initialization. ''' 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):