fix: add explicit UTF-8 encoding to all subprocess text=True calls (#53428)

On Windows with Chinese locale (GBK), subprocess.run(text=True) without
explicit encoding causes UnicodeDecodeError crashes. This fix adds
encoding='utf-8', errors='replace' to all subprocess.run() and
subprocess.Popen() calls that use text=True across 76 non-test Python files.

Fixes #53428 (master tracker for Windows GBK locale crash).

Note: credential_pool.py and electron changes excluded per reviewer request —
those will be submitted as separate focused PRs.
This commit is contained in:
Stoltemberg
2026-06-29 23:42:46 -03:00
committed by Teknium
parent d460118a1d
commit c89481db5e
61 changed files with 161 additions and 161 deletions
+1 -1
View File
@@ -282,7 +282,7 @@ def _process_single_prompt(
print(f" Prompt {prompt_index}: Pulling docker image {container_image}...", flush=True)
pull = _sp.run(
["docker", "pull", container_image],
capture_output=True, text=True, timeout=600,
capture_output=True, text=True, encoding='utf-8', errors='replace', timeout=600,
)
if pull.returncode != 0:
return {