Windows: check_ai.py fails decoding UTF-8 guides with the default locale
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先从 utils/check_ai.py 第 50、75 和 84 行中三处使用隐式编码的 Path.read_text() 调用开始,然后从存储库根目录运行 python utils/check_ai.py。添加一个使用非 UTF-8 默认 locale 的回归测试;完成标准是 checker 始终将 Markdown 作为 UTF-8 读取,并且在 Windows 上无需 -X utf8 即可成功运行。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The documented agent setup check crashes on Windows when Python uses the default CP1252 locale encoding. The checker reads UTF-8 Markdown with Path.read_text() without an explicit encoding.
Reproduced on Windows, CPython 3.12.14, checkout 8b3c707ebd3ec4881f4190cf42931da07eaf3b65. utils/check_ai.py is unchanged between this checkout and my existing attention-mask branch.
Reproduction
From the repository root in an installed development environment:
python utils/check_ai.py
It exits 1 at utils/check_ai.py:50:
prose = CODE_FENCE.sub("", path.read_text())
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 7411: character maps to <undefined>
The same checkout succeeds with:
python -X utf8 utils/check_ai.py
Expected behavior and proposed scope
The check should read repository Markdown consistently as UTF-8, independent of the system locale. There are three implicit-encoding read_text() calls in this script (lines 50, 75, and 84). Proposed fix: specify encoding="utf-8" for all three and add a regression test using a non-UTF-8 default. No .ai files would change.
I can submit this focused fix if that direction is welcome. Two targeted searches for check_ai with encoding/Windows found no duplicate. Reproduction and proposed fix were investigated with AI assistance.
- 主要语言
- Python
- 星标
- 34.6k
- 派生
- 7.4k
- 平均合并
- 3 天 14 小时
- 30 天内合并 PR
- 67
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/diffusers 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
huggingface/diffusers#14864 ·
维护者通常 1 天内回复
-
bug needs-env-info pipelines
难度 2/5 1-3 小时 新手友好度 72/100
huggingface/diffusers#14794 ·
维护者通常 1 天内回复
-
bug needs-code-example needs-env-info pipelines
难度 1/5 1 小时以内 新手友好度 86/100
huggingface/diffusers#14780 · 1 条评论 ·
维护者通常 1 天内回复
-
bug pipelines
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/diffusers#14769 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
huggingface/diffusers#14639 ·
维护者通常 1 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 70/100
kristofdegrave/homeassistant-smart-charging#1413 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
nasa/earthdata-varinfo#113 ·
-
curriculum documentation quality
难度 2/5 1-3 小时 新手友好度 88/100
githubnext/gh-aw-workshop#3849 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复