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 lidiz
Recipients asvetlov, lidiz, yselivanov
Date 2020-02-26.19:25:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This issue exists since 3.6.

The implementation of get stack on Task is looking for two attribute [1]: "cr_frame" for coroutines, "gi_frame" for generators (legacy coroutines). However, PyAsyncGenObject provides none of them but "ag_frame" [2].

Fix PR:

A simple reproduce:

    def test_async_gen_aclose_compatible_with_get_stack(self):
        async def async_generator():
            yield object()

        async def run():
            ag = async_generator()
            tasks = asyncio.all_tasks()
            for task in tasks:
                # No AttributeError raised


I found this in my project I want to view who created the Tasks.

Date User Action Args
2020-02-26 19:25:53lidizsetrecipients: + lidiz, asvetlov, yselivanov
2020-02-26 19:25:53lidizsetmessageid: <>
2020-02-26 19:25:53lidizlinkissue39764 messages
2020-02-26 19:25:53lidizcreate