Upgrade chardet from 5.2.0 to 7.x
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
Start with ricecooker/utils/encodings.py at decode_text and inspect the listed failures in tests/pipeline/test_convert.py, tests/test_files.py, and tests/utils/test_remote_cli.py. Check the chardet.detect() call in ricecooker/utils/html.py as well. Update the dependency pins and compatibility behavior, then verify the four listed tests pass and add coverage for cp1252 HTML served without a charset.
索引モデルが issue の本文から書いたものです。
説明
Overview
Dependabot PR #896 bumped chardet from 5.2.0 to 7.7.0 and failed CI on all 15 jobs, so it was closed. chardet 7 detects short cp1252 text as other encodings and no longer fails on undecodable input. The pinned requests 2.32.5 also rejects it. Land the bump and the code changes it needs in one PR.
Complexity: Medium
Target branch: main
Context
decode_text(ricecooker/utils/encodings.py:163) passeschardet.detect()up to 4 KiB of bytes after the first invalid UTF-8 byte. Under 7.7.0,Caféin cp1252 decodes as ThaiCaf้andMaria’sasMaria\x92s. Subtitles and IMSCP titles upload as mojibake with no error.- Since 7.6.0,
detect()returns only encodings that decode the whole input, so an undecodable subtitle now converts instead of failing. ricecooker/utils/html.py:185also callschardet.detect(), on HTTP text bodies served without a charset.requests2.32.5 checks for chardet<6on import and prints aRequestsDependencyWarningto stderr otherwise. That stderr output breakstest_chef_script_outside_cwd_is_refused.- Tests that fail on #896:
tests/pipeline/test_convert.py::TestIMSCPDecomposition::test_manifest_misdeclared_as_utf8_keeps_titles[late-cp1252-only-byte]tests/test_files.py::test_non_utf8_subtitle_converts_in_its_encodingtests/test_files.py::test_undecodable_subtitle_fails_only_that_filetests/utils/test_remote_cli.py::test_chef_script_outside_cwd_is_refused
The Change
- Bump
chardetto 7.7.0 or later 7.x. - Bump
requeststo ≥2.33.0 in the same PR (open as #897, to 2.34.2). 2.33.0 is the first release that accepts chardet<8. decode_textshould keep returning the 5.2.0 results for cp1252 text and keep failing on undecodable subtitles. chardet 7'sprefer_superset=True(the 8.0 default) andinclude_encodingsare available.- Keep the
html.pycharset guess working under chardet 7.
Acceptance Criteria
-
uv.lockpins chardet 7.x and requests ≥2.33.0. - The four tests listed in Context pass, unchanged, on Python 3.10–3.14 on Linux, macOS and Windows.
- Importing
ricecookerprints noRequestsDependencyWarning. - A test covers
html.py's charset guess for a cp1252text/htmlresponse sent without a charset.
References
- chardet 7.6.0 and 7.7.0 release notes: https://github.com/chardet/chardet/releases
- requests 2.33.0
__init__.py: https://github.com/psf/requests/blob/v2.33.0/src/requests/__init__.py
AI usage
rtibblesbot (Claude Code) reviewed #896, read the failing CI logs and the chardet and requests sources, and drafted this issue.
Filed from #896's review.
- 主要言語
- Python
- スター
- 33
- フォーク
- 83
- 平均マージ
- 5日 16時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
learningequality/ricecooker のほかの issue
-
bug TAG: unit tests
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
learningequality/ricecooker#898 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
learningequality/ricecooker#893 ·
-
TAG: tech update / debt
難易度 3/5 1〜2日 初心者へのやさしさ 1/100
learningequality/ricecooker#891 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
learningequality/ricecooker#890 · コメント 4 件 ·
-
P0 - critical TAG: tech update / debt
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
learningequality/ricecooker#745 ·
learningequality/ricecooker の issue をすべて見る
似ている issue
-
backend: claude chore dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
briandconnelly/amicus#606 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
semantica-agi/semantica#2320 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
vllm-project/vllm-omni#11465 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
jxxghp/MoviePilot#7699 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
vllm-project/vllm-ascend#24010 ·
メンテナーはふだん 1 日以内に返信