fix: name a DAT the importer skips for size

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 14:56:51 +02:00
1 parent 3799d4a1a4
commit be0443a935
2 files changed
+34 -1

No files matched your search

+10 -1
View File
@@ -305,10 +305,19 @@ def _iter_dat_contents(pack: Path) -> Iterator[tuple[str, bytes]]:
if pack.suffix.lower() == ".zip":
with zipfile.ZipFile(pack) as archive:
for info in sorted(archive.infolist(), key=lambda i: i.filename):
if info.is_dir() or info.file_size > MAX_MEMBER_SIZE:
if info.is_dir():
continue
if Path(info.filename).suffix.lower() not in (".dat", ".xml"):
continue
if info.file_size > MAX_MEMBER_SIZE:
# Said out loud: a DAT left out silently ended the run
# on "Unchanged" with a version missing.
print(
f" Skipping {info.filename}: {info.file_size} bytes "
f"exceeds {MAX_MEMBER_SIZE}",
file=sys.stderr,
)
continue
yield info.filename, archive.read(info)
return
yield pack.name, pack.read_bytes()