crewai create flow writes a project file the platform default codec cannot encode
メンテナーはふだん 1 日以内に返信
@shengzhaowei がすでに取り組んでいます。
2026年11月24日 から。
評価
調査の方向性
The bug is in _create_python_flow() and process_file in lib/cli/src/crewai_cli/create_flow.py, which reads the template as UTF-8 but writes it with open(dst_file, "w") and no encoding. Compare with _create_declarative_flow, which uses write_text(content, encoding="utf-8"). Done means the generated tasks.yaml is valid UTF-8 under a non-UTF-8 locale, with a regression test. Pull request #9701 is already open against this issue, so check it before starting.
索引モデルが issue の本文から書いたものです。
説明
Problem
_create_python_flow() in lib/cli/src/crewai_cli/create_flow.py renders the
flow template with process_file, which reads the template as UTF-8 and then
writes the result with the interpreter's locale encoding:
with open(src_file, "r", encoding="utf-8") as file: # read
content = file.read()
...
with open(dst_file, "w") as file: # write: locale encoding
file.write(content)
The templates it renders are UTF-8 and are not ASCII-only:
templates/flow/crews/content_crew/config/tasks.yaml line 45 contains an em
dash (U+2014). On any machine whose default text encoding is not UTF-8 — every
Windows install without the UTF-8 code-page beta (zh-CN is cp936, ja-JP cp932,
…), and any POSIX box under LANG=C — the scaffolded file is written in that
code page instead: the em dash becomes the two bytes a1 aa, which are not
valid UTF-8. So crewai create flow produces a project that the CLI itself
cannot read back:
$ python repro-2.py
locale.getpreferredencoding(False) = cp936
generated demo_flow\src\demo_flow\crews\content_crew\config\tasks.yaml: non-ASCII bytes ['0xa1', '0xaa']
reading it as UTF-8 -> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 1496: invalid start byte
EXPECTED: the generated file is valid UTF-8
ACTUAL: 'utf-8' codec can't decode byte 0xa1 in position 1496: invalid start byte
That file is the crew's tasks_config, loaded through
crewai.project.crew_base.load_yaml, which opens it with
encoding="utf-8" (lib/crewai/src/crewai/project/crew_base.py:391), so
crewai run in the freshly created project dies with
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 1496
before the flow starts. Note that the other writer in the same module —
_create_declarative_flow — already uses
dst_file.write_text(content, encoding="utf-8"), and
crewai_cli.utils.copy_assistant_instructions/write_env_file do the same; the
Python-flow template writer is the one path left on the locale default.
A PR with the one-line fix and a regression test is #9688.
- 主要言語
- Python
- スター
- 61.2k
- フォーク
- 9.2k
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 180
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crewAIInc/crewAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[FEATURE] Add Straitly as a native OpenAI-compatible LLM provider対応中かも @HashimSyedUBC が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Native OpenAI sync streaming with response_model returns an empty string and emits no completed event when the parse is missing対応中かも @basil-k-aji-dev が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[BUG] Native Azure provider ignores the seed setting対応中かも @basil-k-aji-dev が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
crewAIInc/crewAI#9787 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] LiteLLM path reports 0 cached and reasoning tokens in the usage summary対応中かも @basil-k-aji-dev が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
crewAIInc/crewAI の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
compiler-explorer/compiler-explorer#9710 ·
メンテナーはふだん 1 日以内に返信
-
bug harness
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mruangutai/harness#2687 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modal-labs/modal-client#4158 ·
-
kind/bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信