From cf193cf16623565385d1c3be3e30c0cf2148eb9a Mon Sep 17 00:00:00 2001 From: JasonBuildAI Date: Tue, 13 Oct 2026 12:18:16 +0800 Subject: [PATCH] fix(control-plane): pin UTF-8 on the packaged stride schema read The versioned stride control added in #6298 reads the packaged stride_strategy_schema.json with Path.read_text() and no codec. That call decodes with the host locale codec (cp936 on zh-CN Windows), so the shipped-runtime UTF-8 guard tests/test_loopx_text_io_utf8.py (the #4941 class guard from #5160) fails on main, and the read sits on the CLI configuration path (configuration_ui, registry_admin_configure, execution_profile, machine_defaults). Pin encoding="utf-8" like the other shipped-runtime text reads. Signed-off-by: JasonBuildAI --- loopx/control_plane/work_items/stride_policy_codec.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loopx/control_plane/work_items/stride_policy_codec.py b/loopx/control_plane/work_items/stride_policy_codec.py index f911b4041e..7cb68d1ce6 100644 --- a/loopx/control_plane/work_items/stride_policy_codec.py +++ b/loopx/control_plane/work_items/stride_policy_codec.py @@ -13,7 +13,9 @@ @lru_cache(maxsize=1) def stride_strategy_options() -> tuple[str, ...]: - contract = json.loads(files("loopx.control_plane").joinpath("stride_strategy_schema.json").read_text()) + contract = json.loads( + files("loopx.control_plane").joinpath("stride_strategy_schema.json").read_text(encoding="utf-8") + ) return tuple(contract["enum"])