[BUG] crewai-devtools: the test suite fails on Windows because file IO has no encoding
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with the text-mode file calls in lib/devtools/src/crewai_devtools/cli.py and docs_check.py, then review the text reads and writes in lib/devtools/tests/*.py. Run pytest tests -q from lib/devtools on Windows to reproduce the failures. Done means the suite passes and text-mode calls use UTF-8; the issue reports 105 passing tests after the change. An open linked pull request already covers this work.
索引モデルが issue の本文から書いたものです。
説明
[BUG] crewai-devtools: the test suite fails on Windows because file IO has no encoding
What
crewai-devtools reads and writes its own repository files — pyproject.toml, CHANGELOG.md, AGENTS.md, docs pages — with text-mode open() / Path.read_text() / Path.write_text() and no encoding, so the platform default applies: UTF-8 on Linux/macOS and the ANSI code page on Windows.
On Windows the packaged test suite therefore fails out of the box:
$ cd lib/devtools && pytest tests -q
FAILED tests/test_toml_updates.py::TestUpdatePyprojectDependencies::test_default_packages_cover_all_workspace_members
FAILED tests/test_toml_updates.py::test_crewai_pins_every_workspace_sibling_to_its_own_version
2 failed, 103 passed
tests\test_toml_updates.py:437: in test_default_packages_cover_all_workspace_members
root_pyproject = (workspace_root / "pyproject.toml").read_text()
E UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 19647: illegal multibyte sequence
tests\test_toml_updates.py:608: in _crewai_version
match = re.search(r'__version__\s*=\s*"([^"]+)"', init.read_text())
E UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 ...
0x94 is part of a UTF-8 sequence for a typographic quote — the repository's own files contain them (em dashes and curly quotes in the docs and in cli.py's help strings).
Why it matters beyond the tests
The same pattern is in the CLI itself (23 sites in cli.py and docs_check.py): bump-version, tag, release and docs-check all read and rewrite those files. On Windows they hit the same decode error, and where a file does decode, the rewrite is emitted in the ANSI code page — turning a UTF-8 repository file into one that Linux/macOS, git and CI read as mojibake.
Suggested fix
Add encoding="utf-8" to the text-mode calls in lib/devtools/src/crewai_devtools/{cli.py,docs_check.py} and in lib/devtools/tests/*.py (57 call sites). No behaviour change on POSIX, where UTF-8 is already the default; binary opens ("rb"/"wb") are untouched.
Verified on Windows 11 / CPython 3.13 with the package installed editable from lib/devtools:
$ pytest tests -q # before
2 failed, 103 passed
$ pytest tests -q # after the change
105 passed
ruff check on the touched files reports the same findings as HEAD (verified with git stash), so nothing new is introduced.
I will send the patch as the PR for this issue unless you would rather scope it to the tests only.
- 主要言語
- Python
- スター
- 60.6k
- フォーク
- 9.1k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 218
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crewAIInc/crewAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
feature-request
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
crewAIInc/crewAI#9200 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[FEATURE] Docs: ApifyActorsTool example with a typed-input Actor対応中かも @johnisanerd が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
crewAIInc/crewAI#9132 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Scrape tools reject the documented cookies mapping and drop cookies when the URL is passed at runtime対応中かも @Luckyou-d が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[BUG] OpenAI-compatible embedding model alias breaks embedder construction対応中かも @gokay-ai が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
crewAIInc/crewAI#8761 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
crewAIInc/crewAI の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug z-test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
torch-spyre/spyre-inference#1598 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
zilliztech/memsearch#853 ·
メンテナーはふだん 1 日以内に返信
-
IPA charactersオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
tywr/Nordwand-Mono#55 ·
メンテナーはふだん 1 日以内に返信
-
physical
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
antonyrag/ragleap-core#1339 ·