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:
+2
-1
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user