From a5f3efc55564acd6cb40c42dc94a65ce576f4dad Mon Sep 17 00:00:00 2001 From: Peter Zhang <18501667167@qq.com> Date: Wed, 3 Jun 2026 14:39:55 +0800 Subject: [PATCH] fix: subprocess encoding=utf-8 to prevent GBK stdout crash on Windows - Closes #84 Co-Authored-By: Claude Opus 4.7 --- scripts/run_pipeline.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/run_pipeline.py b/scripts/run_pipeline.py index ab27e23..55346b6 100644 --- a/scripts/run_pipeline.py +++ b/scripts/run_pipeline.py @@ -83,7 +83,7 @@ def run_ir_pipeline(parsed_path: str) -> str | None: result = subprocess.run( [sys.executable, str(script_path)], cwd=str(PROJECT_ROOT), - capture_output=True, text=True, + capture_output=True, text=True, encoding="utf-8", env=env, ) if result.returncode != 0: @@ -111,6 +111,8 @@ def run_acceptance_tests(parsed_json_path: str) -> int: print("[3/3] Running QE acceptance tests...") test_dir = PROJECT_ROOT / "tests" / "acceptance" + env = os.environ.copy() + env.setdefault("PYTHONIOENCODING", "utf-8") result = subprocess.run( [ sys.executable, "-m", "pytest", str(test_dir), @@ -120,6 +122,8 @@ def run_acceptance_tests(parsed_json_path: str) -> int: "--tb=short", ], cwd=str(PROJECT_ROOT), + encoding="utf-8", + env=env, ) return result.returncode -- 2.52.0