This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dabeaz
Recipients dabeaz
Date 2018-02-09.19:49:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518205773.11.0.467229070634.issue32810@psf.upfronthosting.co.za>
In-reply-to
Content
Libraries such as Curio and asyncio provide a debugging facility that allows someone to view the call stack of generators/coroutines.  For example, the _task_get_stack() function in asyncio/base_tasks.py.  This works by manually walking up the chain of coroutines (by following cr_frame and gi_frame links as appropriate).   

The only problem is that it doesn't work if control flow falls into an async generator because an "async_generator_asend" instance is encountered and there is no meaningful way to proceed any further with stack inspection.

This problem could be fixed if "async_generator_asend" and "async_generator_athrow" instances exposed the underlying "ags_gen" and "agt_gen" attribute that's held inside the corresponding C structures in Objects/genobject.c.  

Note: I made a quick and dirty "hack" to Python to extract "ags_gen" and verified that having this information would allow me to get complete stack traces in Curio.
History
Date User Action Args
2018-02-09 19:49:33dabeazsetrecipients: + dabeaz
2018-02-09 19:49:33dabeazsetmessageid: <1518205773.11.0.467229070634.issue32810@psf.upfronthosting.co.za>
2018-02-09 19:49:33dabeazlinkissue32810 messages
2018-02-09 19:49:32dabeazcreate