Windows: check_ai.py fails decoding UTF-8 guides with the default locale
まだ誰も着手していません。
評価
調査の方向性
まず、utils/check_ai.py の 50、75、84 行目にある、暗黙のエンコーディングを使用する 3 つの Path.read_text() 呼び出しを確認し、その後リポジトリのルートから python utils/check_ai.py を実行します。UTF-8 ではないデフォルトロケールを使用する回帰テストを追加します。完了条件は、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日 7時間
- マージ済み PR(30日)
- 73
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
huggingface/diffusers のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
huggingface/diffusers#14864 ·
-
bug needs-env-info pipelines
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
huggingface/diffusers#14794 ·
-
bug needs-code-example needs-env-info pipelines
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
huggingface/diffusers#14780 · コメント 1 件 ·
-
bug pipelines
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/diffusers#14769 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
huggingface/diffusers#14639 ·
huggingface/diffusers の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·