fix(update): run the isolated completion child in UTF-8 mode (hardening, win-utf8 review)

The parent already decodes the child's piped output as UTF-8; -X utf8 makes the child encode it
that way on any console code page. The reviewed failure was invalid on re-verification; this is
the one-token hardening the triage allowed. test_update_completion_process.py failure set unchanged.
This commit is contained in:
Teknium
2026-10-05 00:53:33 -07:00
parent e28c05e4b0
commit 2e05ebb1e2

View File

@@ -56,7 +56,7 @@ def run_completion(request: dict) -> dict:
request = {**request, "stdout_isatty": sys.stdout.isatty()}
request["bytecode_cache"] = str(Path(directory) / "bytecode")
_write_json(request_path, request)
command = [sys.executable, "-I", "-S", "-u", "-X", f"pycache_prefix={request['bytecode_cache']}",
command = [sys.executable, "-I", "-S", "-u", "-X", "utf8", "-X", f"pycache_prefix={request['bytecode_cache']}",
str(root / "hermes_cli/update_completion.py"),
str(request_path), str(result_path)]
proc = subprocess.Popen(