Skip to content

fix: read measurement templates as UTF-8 regardless of locale - #42

Merged
Anai-Guo merged 1 commit into
mainfrom
chore/auto-maint-2026-10-12
Oct 13, 2026
Merged

Anai-Guo merged 1 commit into
mainfrom
chore/auto-maint-2026-10-12

Conversation

@Anai-Guo

Copy link
Copy Markdown
Owner

自动维护改动

类型:维护(小 bug 修复)
改动:plan_builder._load_template 显式以 UTF-8 打开模板 YAML(内置 high_r.yaml 已含 Ω;Windows 默认 cp1252 等旧代码页下非 ASCII 的名称/描述/单位会被解码成乱码或报 UnicodeDecodeError),与 #36 对 models.yaml 的修复一致;新增回归测试模拟非 UTF-8 locale(修复前失败:I-V ÎΩ sweep,修复后通过)。
测试:通过(tests/test_plan_builder.py 11 passed;全量 485 passed / 1 skipped;ruff check + format 通过)
参考:无

本 PR 由每日维护任务生成,请人工 review 后再合并。

🤖 Generated with Claude Code

_load_template opened template YAML files with the platform default
encoding. Built-in templates already contain non-ASCII text (high_r.yaml
mentions the ohm sign), and Windows lab PCs usually default to a legacy
code page such as cp1252, so any non-ASCII name, description or unit in
a template would be decoded as mojibake (or raise UnicodeDecodeError).
Open templates explicitly as UTF-8, matching the earlier models.yaml fix,
and add a regression test that simulates a non-UTF-8 locale so it also
runs on Linux CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Anai-Guo
Anai-Guo merged commit 6c00de5 into main Oct 13, 2026
3 checks passed
@Anai-Guo
Anai-Guo deleted the chore/auto-maint-2026-10-12 branch October 13, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant