fix(windows): sweep remaining unguarded text-mode subprocess sites codebase-wide

AST-driven pass over every subprocess.run/Popen/check_output/check_call/call
with text=True (or universal_newlines=True) and no explicit encoding=:
append encoding='utf-8', errors='replace' at the kwarg site. 136 call
sites across 28 files (cli.py, hermes_cli/main.py, tools_config.py,
environments, computer_use, gateway, scripts, skills helpers, agent/*).

Together with the salvaged #55339/#60741 commits this closes out issue
#53428's bug class; the salvaged #60751 linter rule in
check-windows-footguns.py now enforces it repo-wide (verified: 807 files
scanned, zero findings).
This commit is contained in:
teknium1 2026-07-24 10:05:18 -07:00 committed by Teknium
parent 051217342b
commit d4b867cf9f
28 changed files with 138 additions and 136 deletions

View file

@ -183,7 +183,7 @@ def _reinstall_sidecar_deps() -> None:
[npm, "ci"],
cwd=str(_SIDECAR_DIR),
capture_output=True,
text=True,
text=True, encoding="utf-8", errors="replace",
check=False,
timeout=_NPM_REINSTALL_TIMEOUT,
creationflags=windows_hide_flags(),
@ -196,7 +196,7 @@ def _reinstall_sidecar_deps() -> None:
[npm, "install"],
cwd=str(_SIDECAR_DIR),
capture_output=True,
text=True,
text=True, encoding="utf-8", errors="replace",
check=False,
timeout=_NPM_REINSTALL_TIMEOUT,
creationflags=windows_hide_flags(),

View file

@ -355,7 +355,7 @@ def _probe_voice_duration_seconds(path: str) -> Optional[int]:
proc = subprocess.run(
["ffprobe", "-v", "error", "-show_entries", "format=duration",
"-of", "default=noprint_wrappers=1:nokey=1", path],
capture_output=True, text=True, timeout=5,
capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=5,
)
if proc.returncode == 0:
return _coerce_duration_seconds(proc.stdout.strip())