Repository navigation
fix: read web API templates as UTF-8 regardless of locale - #43
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
自动维护改动
类型:维护(小 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.py7 passed;回归测试在未修复代码上失败、修复后通过;全量 485 passed / 1 skipped。[tests: 部分未验证] 注意:CI 的.[dev]不含 fastapi,tests/test_web_api.py在 CI 中整模块 skip,新测试在 CI 上不会执行。参考:无
本 PR 由每日维护任务生成,请人工 review 后再合并。
🤖 Generated with Claude Code