Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Windows: check_ai.py fails decoding UTF-8 guides with the default locale

オープン 初心者向け
#14,837 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

まず、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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

huggingface/diffusers のほかの issue

huggingface/diffusers の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。