[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

Dennis Sweeney report at bugs.python.org
Sun Nov 21 14:56:23 EST 2021


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Even without garbage-collecting the coroutine, we get a failed assertion in debug mode (but no crash with the assertion removed):

Python 3.11.0a2+ (heads/main:c8c21bdd19, Nov 21 2021, 13:58:01) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> async def f():
...     pass
...
>>> coro = f()
>>> frame = coro.cr_frame
>>> frame.clear()
<stdin>:1: RuntimeWarning: coroutine 'f' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Assertion failed: f->f_frame->generator == NULL, file C:\Users\sween\Source\Repos\cpython2\cpython\Objects\frameobject.c, line 705

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________


More information about the Python-bugs-list mailing list