GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Cancellation leaks out of asyncio.TaskGroup on 3.12 when using eager tasks · Issue #128588 · python/cpython Closed Labels 3.12only security fixesonly security fixestopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:import sys import asyncio if sys.platform == "win32": EventLoop = asyncio.ProactorEventLoop else: EventLoop = asyncio.SelectorEventLoop async def demo(): class MyError(Exception): pass async def throw_error(): raise MyError try: async with asyncio.TaskGroup() as tg: tg.create_task(throw_error()) except* MyError: pass def loop_factory(): loop = EventLoop() loop.set_task_factory(asyncio.eager_task_factory) return loop asyncio.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 run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ asyncio.exceptions.CancelledError CPython versions tested on:3.12 Operating systems tested on:Linux Linked PRs
Activity
MetadataMetadataAssigneesLabels3.12only security fixesonly security fixestopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |