TypeError: create_task() got an unexpected keyword argument 'eager_start'
还没有人认领这个 Issue。
评估
调研方向
从 loop.pyx 中的 uvloop.loop.Loop.create_task 开始,traceback 显示 Python 3.14 的关键字参数 eager_start 被拒绝,并将其与 asyncio.create_task 的行为进行比较。确定 uvloop 应如何接受并遵循 eager_start=True,而不是仅仅忽略它;当所报告的调用在 uvloop 下以预期的 eager-start 语义正常工作时,即表示完成。
由索引模型根据 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 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MagicStack/uvloop 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
MagicStack/uvloop#759 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
MagicStack/uvloop#741 · 2 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 68/100
MagicStack/uvloop#702 · 8 条评论 · 9 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
MagicStack/uvloop#766 ·
-
难度 4/5 3-5 天 新手友好度 52/100
MagicStack/uvloop#765 ·
查看 MagicStack/uvloop 的全部 Issue
相似的 Issue
-
bug customer-eng Durable Agents Inngest status: needs triage
难度 2/5 1-3 小时 新手友好度 82/100
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
-
integration: elevenlabs
难度 1/5 1 小时以内 新手友好度 88/100
home-assistant/core#182944 · 1 条评论 ·
-
ai-observability bug team/ai-observability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
vicharanashala/fln#563 ·