fix(core): decode subprocess output as UTF-8 with replacement

Strict UTF-8 decode of external tool output (ffmpeg/shaka/mp4decrypt) crashed reader threads on non-English Windows (cp950/Big5).
This commit is contained in:
imSp4rky
2026-07-07 09:23:05 -06:00
parent 5cd50544a8
commit 1dba4a8f82
15 changed files with 72 additions and 13 deletions
+3 -1
View File
@@ -84,7 +84,9 @@ def info_summary(rpu: Path) -> str:
"""Return the textual summary (`dovi_tool info -i ... -s`) for an RPU file."""
tool = _require_dovi_tool()
info_start = time.monotonic()
p = subprocess.run([tool, "info", "-i", str(rpu), "-s"], capture_output=True, text=True)
p = subprocess.run(
[tool, "info", "-i", str(rpu), "-s"], capture_output=True, text=True, encoding="utf-8", errors="replace"
)
log_tool_run(
"dovi_tool info",
"dovi_tool",
+1 -1
View File
@@ -66,7 +66,7 @@ def ffprobe(uri: Union[bytes, Path]) -> dict:
context={"tool": "ffprobe", "duration_ms": round((time.monotonic() - start) * 1000, 1)},
)
return {}
result = json.loads(ff.stdout.decode("utf8"))
result = json.loads(ff.stdout.decode("utf-8", errors="replace"))
if dl:
dl.log(
level="DEBUG",
+2
View File
@@ -41,6 +41,8 @@ def apply_tags(path: Path, tags: dict[str, str]) -> None:
check=False,
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
)
log_tool_run(
"mkvpropedit tags",