Pin Python SDK app-server stdio to UTF-8 on Windows (#15244)

## TL;DR
Pin the Python app-server SDK subprocess pipes to UTF-8 so Windows users
on non-UTF-8 locales do not hit `UnicodeDecodeError` when the `codex`
child emits UTF-8 text.

- add `encoding="utf-8"` to the `subprocess.Popen(...)` call in
`AppServerClient.start()`
- add a focused regression test that asserts the client launches the
subprocess with UTF-8 text I/O
- validates with `python -m pytest
sdk/python/tests/test_client_rpc_methods.py
sdk/python/tests/test_client_process_launch.py
sdk/python/tests/test_public_api_runtime_behavior.py`

Fixes #14311.
This commit is contained in:
Shaqayeq 2026-03-20 11:26:24 -07:00 committed by GitHub
parent 79ad7b247b
commit 9e31aeadce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,6 +181,7 @@ class AppServerClient:
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
encoding="utf-8",
cwd=self.config.cwd,
env=env,
bufsize=1,