From 9e31aeadce22fad2cdb7d2d90e7e7bbb9ac4dc77 Mon Sep 17 00:00:00 2001 From: Shaqayeq Date: Fri, 20 Mar 2026 11:26:24 -0700 Subject: [PATCH] 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. --- sdk/python/src/codex_app_server/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/python/src/codex_app_server/client.py b/sdk/python/src/codex_app_server/client.py index aa7b574a3..146d5186e 100644 --- a/sdk/python/src/codex_app_server/client.py +++ b/sdk/python/src/codex_app_server/client.py @@ -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,