extract_all: tolerate non-UTF8 7z output, manifest-based skip, final stranded-archive sweep; same decode fix in sorter list_7z and zero807

This commit is contained in:
2026-10-05 13:46:55 +02:00
parent 86fcb3aecc
commit 04baa2fd2a
3 changed files with 77 additions and 15 deletions
+2 -1
View File
@@ -86,7 +86,8 @@ def list_7z(path: Path, limit: int = 40) -> list[str]:
try:
proc = subprocess.run(
["7z", "l", "-ba", "-slt", str(path)],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True, timeout=120,
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
encoding="utf-8", errors="replace", timeout=120,
)
except (OSError, subprocess.TimeoutExpired) as exc:
log.debug("7z listing failed for %s: %s", path.name, exc)
+2 -1
View File
@@ -72,7 +72,8 @@ def download(
cmd.append(url)
log.info("Downloading %s -> %s", url, dest.name)
proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
encoding="utf-8", errors="replace")
if proc.returncode != 0:
tail = [line for line in proc.stderr.strip().splitlines() if line][-3:]
stderr = " | ".join(tail)