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