From ca7042dec279d57139c17cc602e1fb674e4f469c Mon Sep 17 00:00:00 2001 From: john lee <64lamei@gmail.com> Date: Thu, 21 May 2026 16:42:26 +0800 Subject: [PATCH] chore(windows): add PYTHONIOENCODING and PYTHONUTF8 to backend Makefile targets (#3069) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit langgraph-api emits → and ⚠️ characters in version-check log lines. On Windows with cp1252 as the default stream encoding, each such line throws a UnicodeEncodeError inside the logging handler, littering startup output with tracebacks (though the server still boots). #1550 already fixed this for scripts/check.py via stream.reconfigure(). Apply the same treatment to the backend Makefile dev/gateway/test targets by setting PYTHONIOENCODING=utf-8 and PYTHONUTF8=1 before each uv run invocation. Both variables are no-ops on Linux/macOS where UTF-8 is already the default. Closes #2337 Co-authored-by: Claude Sonnet 4.6 --- backend/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Makefile b/backend/Makefile index 81a055684..a1206547b 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -2,13 +2,13 @@ install: uv sync dev: - PYTHONPATH=. uv run uvicorn app.gateway.app:app --host 0.0.0.0 --port 8001 --reload + PYTHONPATH=. PYTHONIOENCODING=utf-8 PYTHONUTF8=1 uv run uvicorn app.gateway.app:app --host 0.0.0.0 --port 8001 --reload gateway: - PYTHONPATH=. uv run uvicorn app.gateway.app:app --host 0.0.0.0 --port 8001 + PYTHONPATH=. PYTHONIOENCODING=utf-8 PYTHONUTF8=1 uv run uvicorn app.gateway.app:app --host 0.0.0.0 --port 8001 test: - PYTHONPATH=. uv run pytest tests/ -v + PYTHONPATH=. PYTHONIOENCODING=utf-8 PYTHONUTF8=1 uv run pytest tests/ -v lint: uvx ruff check .