From 1d7e374e5b0c6a84b3319d9d1e7c6f5c222af878 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Tue, 4 Sep 2018 16:15:39 -0400
Subject: [PATCH] office: try all members, even when one fails

the end result will be the same -- an abort -- but the user will get
to see all the warnings for a particular file, instead of getting them
one at a time.
---
 libmat2/office.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libmat2/office.py b/libmat2/office.py
index e48773a..e79fe58 100644
--- a/libmat2/office.py
+++ b/libmat2/office.py
@@ -98,11 +98,10 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
                 full_path = os.path.join(temp_folder, item.filename)
 
                 if self._specific_cleanup(full_path) is False:
-                    shutil.rmtree(temp_folder)
-                    os.remove(self.output_filename)
                     logging.warning("Something went wrong during deep cleaning of %s",
                                     item.filename)
-                    return False
+                    abort = True
+                    continue
 
                 if item.filename in self.files_to_keep:
                     # those files aren't supported, but we want to add them anyway
-- 
GitLab