Commit a1a06d02 authored by jvoisin's avatar jvoisin

Insert archive members in lexicographic order

parent 9275d64b
Pipeline #18997 passed with stages
in 3 minutes and 19 seconds
......@@ -74,7 +74,9 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
temp_folder = tempfile.mkdtemp()
abort = False
for item in zin.infolist():
# Since files order is a fingerprint factor,
# we're iterating (and thus inserting) them in lexicographic order.
for item in sorted(zin.infolist(), key=lambda z: z.filename):
if item.filename[-1] == '/': # `is_dir` is added in Python3.6
continue # don't keep empty folders
......@@ -92,8 +94,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
elif any(map(lambda r:, self.files_to_omit)):
# supported files that we want to clean then add
else: # supported files that we want to first clean, then add
tmp_parser, mtype = parser_factory.get_parser(full_path) # type: ignore
if not tmp_parser:
if self.unknown_member_policy == UnknownMemberPolicy.OMIT:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment