Skip to content
Snippets Groups Projects
Commit e740a955 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Properly handle an exception

```
Traceback (most recent call last):
  File "/builds/jvoisin/mat2/tests/test_deep_cleaning.py", line 147, in test_office
    meta = p.get_meta()
  File "/builds/jvoisin/mat2/libmat2/archive.py", line 155, in get_meta
    zin.extract(member=item, path=temp_folder)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/zipfile/__init__.py", line 1762, in extract
    return self._extract_member(member, path, pwd)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/zipfile/__init__.py", line 1829, in _extract_member
    os.makedirs(upperdirs, exist_ok=True)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 227, in makedirs
OSError: [Errno 28] No space left on device: '/tmp/tmptl1ibyv6/word/theme'
```

This should never happen™, but just in case…
parent 2b58eece
Branches
No related tags found
No related merge requests found
Pipeline #274244 failed
......@@ -152,7 +152,10 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
self.filename, member_name, full_path)
break
zin.extract(member=item, path=temp_folder)
try:
zin.extract(member=item, path=temp_folder)
except OSError as e:
logging.error("Unable to extraxt %s from %s: %s", item, self.filename, e)
os.chmod(full_path, stat.S_IRUSR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment