You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asyncio.print_call_graph() loses the call stack at anext(agen, default) #157032
* Task(name='worker', id=0x103a049b0)
+ Call stack:
| File '/Users/timofeiivankov/cpython/Lib/asyncio/locks.py', line 210, in async Event.wait()
| File '/Users/timofeiivankov/cpython/repro.py', line 4, in async deep()
| File '/Users/timofeiivankov/cpython/repro.py', line 7, in async generator rows()
| File '/Users/timofeiivankov/cpython/repro.py', line 11, in async worker()
Actual:
* Task(name='worker', id=0x1035c89b0)
+ Call stack:
| File '/Users/timofeiivankov/cpython/repro.py', line 11, in async worker()
Proposed fix: expose ag_gen on anext_awaitable like #156984 do
Important: Currently this issue have a blocker from #156984 (issue - #156980) because it depends on the fix of it. I have a fix ready and will open a PR once #156984 is merged
This is a great catch. The 2-argument form of anext(agen, default) handles StopAsyncIteration via an internal wrapper, which appears to drop the waiting generator's frame from the call graph traversal.
I would like to work on fixing the edge propagation in asyncio.print_call_graph() so that the waiting generator's stack is preserved, and add corresponding test coverage under Lib/test/test_asyncio/.
May I take this up? Please let me know if I can go ahead.
This is a great catch. The 2-argument form of anext(agen, default) handles StopAsyncIteration via an internal wrapper, which appears to drop the waiting generator's frame from the call graph traversal.
I would like to work on fixing the edge propagation in asyncio.print_call_graph() so that the waiting generator's stack is preserved, and add corresponding test coverage under Lib/test/test_asyncio/.
May I take this up? Please let me know if I can go ahead.
Hello, there are disclaimer in the end of issue text
Important: Currently this issue have a blocker from #156984 (issue - #156980) because it depends on the fix of it. I have a fix ready and will open a PR once #156984 is merged
Activity
VimalN2005 commentedon Sep 12, 2026
Hi!
This is a great catch. The 2-argument form of
anext(agen, default)handlesStopAsyncIterationvia an internal wrapper, which appears to drop the waiting generator's frame from the call graph traversal.I would like to work on fixing the edge propagation in
asyncio.print_call_graph()so that the waiting generator's stack is preserved, and add corresponding test coverage underLib/test/test_asyncio/.May I take this up? Please let me know if I can go ahead.
deadlovelll commentedon Sep 12, 2026
Hello, there are disclaimer in the end of issue text
anextandaiterin pure Python #157361