Windows: check_ai.py fails decoding UTF-8 guides with the default locale
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
Bắt đầu với ba lệnh gọi Path.read_text() sử dụng mã hóa ngầm định trong utils/check_ai.py tại các dòng 50, 75 và 84, sau đó chạy python utils/check_ai.py từ thư mục gốc của repository. Thêm một kiểm thử hồi quy sử dụng locale mặc định không phải UTF-8; hoàn thành khi checker đọc Markdown nhất quán dưới dạng UTF-8 và chạy thành công trên Windows mà không cần -X utf8.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 34.6k
- Fork
- 7.4k
- Merge trung bình
- 3 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 73
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của huggingface/diffusers
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
huggingface/diffusers#14864 ·
-
bug needs-env-info pipelines
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
huggingface/diffusers#14794 ·
-
bug needs-code-example needs-env-info pipelines
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
huggingface/diffusers#14780 · 1 bình luận ·
-
bug pipelines
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
huggingface/diffusers#14769 · 1 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
huggingface/diffusers#14639 ·
Tất cả issue của huggingface/diffusers
Issue tương tự
-
agent-ready documentation needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Add https://search.jeremyh.xyz/ Đang mởinstance instance add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
searxng/searx-instances#939 · 1 bình luận ·
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100