Repository navigation
Don't override task factory's eager_start default - #779
Open
chrisjbillington wants to merge 1 commit into
Open
chrisjbillington wants to merge 1 commit into
chrisjbillington wants to merge 1 commit into
Conversation
PR MagicStack#748 introduced a regression by passing `eager_start=None` to the task factory when not provided by the caller. On Python 3.14 this is interpreted as `False`, overriding `asyncio.eager_task_factory`'s default of `eager_start=True` and resulting in non-eager tasks. On Python 3.13, it's a `TypeError` , since `eager_task_factory` and user factories with the `(loop, coro, *, name=None, context=None)` signature do not accept an `eager_start` argument at all. Forward `eager_start` to the factory and to `Task` only when provided by the caller. This matches the behaviour of `asyncio`'s loop. Add tests for behaviour when `eager_start=False` and when not provided.
chrisjbillington
force-pushed
the
fix-eager-task-factory
branch
from
October 16, 2026 10:30
0d44045 to
ca901bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #748 introduced a regression by passing
eager_start=Noneto thetask factory when not provided by the caller. On Python 3.14 this is
interpreted as
False, overridingasyncio.eager_task_factory'sdefault of
eager_start=Trueand resulting in non-eager tasks. OnPython 3.13, it's a
TypeError, sinceeager_task_factoryand userfactories with the
(loop, coro, *, name=None, context=None)signaturedo not accept an
eager_startargument at all.Forward
eager_startto the factory and toTaskonly when provided bythe caller. This matches the behaviour of
asyncio's loop.Add tests for behaviour when
eager_start=Falseand when not provided.Fixes #754 (the TypeError on Python 3.13).
Disclosure: Bug found and patch and tests were written by Claude Fable 5.1. But I can confirm the bug on 3.14 and that this fixes it, and the reason for the regression is obvious.