Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Labels
3.12only security fixesonly security fixestopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
importsysimportasyncioifsys.platform=="win32": EventLoop=asyncio.ProactorEventLoopelse: EventLoop=asyncio.SelectorEventLoopasyncdefdemo(): classMyError(Exception): passasyncdefthrow_error(): raiseMyErrortry: asyncwithasyncio.TaskGroup() astg: tg.create_task(throw_error()) except* MyError: passdefloop_factory(): loop=EventLoop() loop.set_task_factory(asyncio.eager_task_factory) returnloopasyncio.run(demo(), loop_factory=loop_factory)results in:
Traceback (most recent call last): File "/home/graingert/projects/anyio/demo.py", line 29, in <module> asyncio.run(demo(), loop_factory=loop_factory) File "/usr/lib/python3.12/asyncio/runners.py", line 194, in runreturn runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/runners.py", line 118, in runreturnself._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_completereturn future.result() ^^^^^^^^^^^^^^^ asyncio.exceptions.CancelledErrorCPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
- gh-128588: gh-128550: remove eager tasks optimization that missed and introduced incorrect cancellations #129063
- [3.13] gh-128588: gh-128550: remove eager tasks optimization that missed and introduced incorrect cancellations (GH-129063) #129089
- [3.12] gh-128588: gh-128550: gh-128552: fix refcycles in eager task creation (#128553) and remove eager tasks optimization that missed and introduced incorrect cancellations (python#129063) #128586
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixestopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done