--- a/src/pyams_file/archive/zip.py Fri Nov 16 15:16:10 2018 +0100
+++ b/src/pyams_file/archive/zip.py Mon Nov 19 13:24:44 2018 +0100
@@ -12,16 +12,11 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
+import zipfile
from io import BytesIO
-import zipfile
-# import interfaces
+from pyams_file.file import get_magic_content_type
from pyams_file.interfaces.archive import IArchiveExtractor
-
-# import packages
-from pyams_file.file import get_magic_content_type
from pyams_utils.registry import query_utility, utility_config
@@ -41,6 +36,8 @@
for member in members:
filename = member.filename
content = self.zip_data.read(filename)
+ if not content: # skip empty files and directories
+ continue
mime_type = get_magic_content_type(content[:4096])
extractor = query_utility(IArchiveExtractor, name=mime_type)
if extractor is not None: