Skip to content

fix: read web API templates as UTF-8 regardless of locale - #43

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

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

Conversation

@Anai-Guo

Copy link
Copy Markdown
Owner

自动维护改动

类型:维护(小 bug 修复)
改动:web/app.py 的 /api/templates 与 /api/templates/{type} 两处显式以 UTF-8 读取模板 YAML(与 #42 对 plan_builder 的修复一致),避免 Windows cp1252 区域设置下含 Ω 等非 ASCII 字符的模板乱码/解码失败;新增回归测试模拟 cp1252 区域。
测试:本地安装 .[dev,web] 后 tests/test_web_api.py 7 passed;回归测试在未修复代码上失败、修复后通过;全量 485 passed / 1 skipped。[tests: 部分未验证] 注意:CI 的 .[dev] 不含 fastapi,tests/test_web_api.py 在 CI 中整模块 skip,新测试在 CI 上不会执行。
参考:无

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

🤖 Generated with Claude Code

The /api/templates and /api/templates/{type} endpoints opened template
YAML with the platform default encoding. Built-in templates contain
non-ASCII text (e.g. the ohm sign), so on Windows lab PCs with a legacy
code page such as cp1252 the web dashboard would show mojibake or fail.
Open them explicitly as UTF-8, matching the plan_builder fix in #42,
and add a regression test that simulates a cp1252 locale.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Anai-Guo
Anai-Guo merged commit 732ed2c into main Oct 15, 2026
3 checks passed
@Anai-Guo
Anai-Guo deleted the chore/auto-maint-2026-10-13 branch October 15, 2026 10:30
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