-
-
Couldn't load subscription status.
- Fork 33.3k
Closed as not planned
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Python 3.14 contains a regression, in which _PyTask objects created with a custom task factory fail to register as a current task. The following code asserts on python 3.14 while succeeding on 3.13.
import asyncio
def custom_factory(loop, coro, **kwargs):
from asyncio.tasks import _PyTask
return _PyTask(coro, loop=loop, **kwargs)
async def check_current_task():
task = asyncio.current_task()
assert task is not None, "asyncio.current_task() returned None"
return task
async def main():
loop = asyncio.get_running_loop()
loop.set_task_factory(custom_factory)
task = loop.create_task(check_current_task())
result = await task
print(f"Success: {result}")
if __name__ == "__main__":
asyncio.run(main())CPython versions tested on:
3.14
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done