[diffoscope] 01/01: {tempfiles, utils.archive}: catches FileNotFoundError
Juliana Oliveira
jwnx-guest at moszumanska.debian.org
Wed Jan 31 16:49:54 CET 2018
This is an automated email from the git hooks/post-receive script.
jwnx-guest pushed a commit to branch master
in repository diffoscope.
commit 016a89ed16f083b5865405a0599b5586bf387ad4
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date: Sun Jan 14 16:44:32 2018 -0200
{tempfiles, utils.archive}: catches FileNotFoundError
FileNotFoundError is randomly found when spawning async processes
Signed-off-by: Juliana Oliveira <juliana.orod at gmail.com>
---
diffoscope/comparators/utils/archive.py | 5 ++++-
diffoscope/tempfiles.py | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/diffoscope/comparators/utils/archive.py b/diffoscope/comparators/utils/archive.py
index 510dff0..7e4828f 100644
--- a/diffoscope/comparators/utils/archive.py
+++ b/diffoscope/comparators/utils/archive.py
@@ -101,7 +101,10 @@ class ArchiveMember(File):
if self._path is not None:
self._path = None
if self._temp_dir is not None:
- self._temp_dir.cleanup()
+ try:
+ self._temp_dir.cleanup()
+ except FileNotFoundError:
+ pass
self._temp_dir = None
super().cleanup()
diff --git a/diffoscope/tempfiles.py b/diffoscope/tempfiles.py
index 833ac16..50fa825 100644
--- a/diffoscope/tempfiles.py
+++ b/diffoscope/tempfiles.py
@@ -60,5 +60,7 @@ def clean_all_temp_files():
for x in _DIRS:
try:
x.cleanup()
+ except FileNotFoundError:
+ pass
except:
logger.exception("Unable to delete %s", x)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list