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 — `python -m asyncio pstree` loses nodes on Task → Future → Task chains · Issue #161502 · python/cpython Open Labels stdlibStandard 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 DescriptionBug reportWhen one task awaits another through a Future, Repro: import asyncio import os async def main(): asyncio.current_task().set_name("main") task = asyncio.create_task(asyncio.sleep(3600), name="worker") future = asyncio.get_running_loop().create_future() asyncio.future_add_to_awaited_by(task, future) task.add_done_callback(future.set_result) print(os.getpid(), flush=True) try: await future finally: asyncio.future_discard_from_awaited_by(task, future) asyncio.run(main()) Run: Output: Expected output: For example import asyncio async def worker(): asyncio.print_call_graph(limit=0) async def main(): asyncio.current_task().set_name("main") task = asyncio.create_task(worker(), name="worker") future = asyncio.get_running_loop().create_future() asyncio.future_add_to_awaited_by(task, future) task.add_done_callback(future.set_result) try: await future finally: asyncio.future_discard_from_awaited_by(task, future) asyncio.run(main()) Proposed fix: add Future support in the _remote_debugging I'll work on this CPython versions tested on:CPython main branch Operating systems tested on:macOS Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard 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
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. |