TypeError: create_task() got an unexpected keyword argument 'eager_start'
まだ誰も着手していません。
評価
調査の方向性
loop.pyx の uvloop.loop.Loop.create_task から始めます。ここでは traceback によって、Python 3.14 のキーワード引数 eager_start が拒否されていることが示されています。asyncio.create_task の動作と比較してください。eager_start=True を単に無視するのではなく、uvloop が受け入れて尊重するにはどうすべきかを特定します。完了とは、報告された呼び出しが意図された eager-start セマンティクスで uvloop 上で動作することです。
索引モデルが issue の本文から書いたものです。
説明
python 3.14.2 asyncio.create_task() accepts a kwarg eager_start: True. uvloop 0.22.1 does not and raises a type error:
File "/Users/enda/Workspaces/project/api/src/prject/queries/counts.py", line 84, in _single_flight
task = asyncio.create_task(_run(), name=f"single_flight:{key}", eager_start=True)
File "/Users/enda/.local/share/uv/python/cpython-3.14.2-macos-aarch64-none/lib/python3.14/asyncio/tasks.py", line 395, in create_task
return loop.create_task(coro, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1415, in uvloop.loop.Loop.create_task
TypeError: create_task() got an unexpected keyword argument 'eager_start'
I understand that "accept but ignore-with-a-warning" is not a desirable approach as developers will expect that passing this in as True will cause the task to start eagerly. However, at present the first sentence of the project "uvloop is a fast, drop-in replacement of the built-in asyncio event loop. " is no longer100% accurate and that's not desired either.
I've only recently become aware of eager_start but it /seems/ to have been in discussion for over 18 months: https://discuss.python.org/t/make-asyncio-eager-task-factory-default/75164 (and uvloop gets a mention in there).
As I don't know what is involved in accepting and respecting an eager_start=True I don't want to say what I expect this issue to amount to, but it made its way pasting our testing as we were not using uvloop in the original tests which covered our _single_flight code, but our deployed code hit it. Clearly we have now fixed that testing oversite but others may experience this too.
- 主要言語
- Cython
- スター
- 11.9k
- フォーク
- 615
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MagicStack/uvloop のほかの issue
-
License not clear オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MagicStack/uvloop#759 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MagicStack/uvloop#741 · リアクション 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MagicStack/uvloop#702 · コメント 8 件 · リアクション 9 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
MagicStack/uvloop#763 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
MagicStack/uvloop#760 ·
MagicStack/uvloop の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
avniproject/avni-client#2135 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
good first issue refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100