From 721ee78d15b69d06bd46920a2c1e988ea8d44288 Mon Sep 17 00:00:00 2001 From: jvoisin <julien.voisin@dustri.org> Date: Mon, 2 Apr 2018 23:35:03 +0200 Subject: [PATCH] Fix a mistake wrt. office handling --- src/office.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/office.py b/src/office.py index 8d478c1..1c5e795 100644 --- a/src/office.py +++ b/src/office.py @@ -39,14 +39,14 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): def _clean_internal_file(self, item:zipfile.ZipInfo, temp_folder:str, zin:zipfile.ZipFile, zout:zipfile.ZipFile): zin.extract(member=item, path=temp_folder) tmp_parser, mtype = parser_factory.get_parser(os.path.join(temp_folder, item.filename)) - if tmp_parser is None: + if not tmp_parser: print("%s's format (%s) isn't supported" % (item.filename, mtype)) return tmp_parser.remove_all() zinfo = zipfile.ZipInfo(item.filename) - item = self._clean_zipinfo(item) + clean_zinfo = self._clean_zipinfo(zinfo) with open(tmp_parser.output_filename, 'rb') as f: - zout.writestr(zinfo, f.read()) + zout.writestr(clean_zinfo, f.read()) class MSOfficeParser(ArchiveBasedAbstractParser): mimetypes = { -- GitLab