fix(tools): utf-8 decode for STT/TTS command-provider popen_kwargs
Salvaged from PR #45099 — the two popen_kwargs dict sites the #70875 AST sweep missed because the kwargs are built indirectly (_run_command_stt, _run_command_tts).
This commit is contained in:
@@ -556,6 +556,10 @@ def _run_command_stt(command: str, timeout: float) -> subprocess.CompletedProces
|
||||
"stdout": subprocess.PIPE,
|
||||
"stderr": subprocess.PIPE,
|
||||
"text": True,
|
||||
# Lossy UTF-8 decode — locale-mismatched bytes from the STT command
|
||||
# must not raise in the reader threads on non-UTF-8 Windows (#45099).
|
||||
"encoding": "utf-8",
|
||||
"errors": "replace",
|
||||
"env": delegated_child_subprocess_env(),
|
||||
}
|
||||
if os.name == "nt":
|
||||
|
||||
@@ -782,6 +782,10 @@ def _run_command_tts(command: str, timeout: float) -> subprocess.CompletedProces
|
||||
"stdout": subprocess.PIPE,
|
||||
"stderr": subprocess.PIPE,
|
||||
"text": True,
|
||||
# Lossy UTF-8 decode — locale-mismatched bytes from the TTS command
|
||||
# must not raise in the reader threads on non-UTF-8 Windows (#45099).
|
||||
"encoding": "utf-8",
|
||||
"errors": "replace",
|
||||
"env": delegated_child_subprocess_env(),
|
||||
}
|
||||
if os.name == "nt":
|
||||
|
||||
Reference in New Issue
Block a user