[issue39116] StreamReader.readexactly() raises GeneratorExit on ProactorEventLoop
twisteroid ambassador
report at bugs.python.org
Mon Oct 19 04:07:48 EDT 2020
twisteroid ambassador <twisteroid.ambassador at gmail.com> added the comment:
This problem still exists on Python 3.9 and latest Windows 10.
I tried to catch the GeneratorExit and turn it into a normal Exception, and things only got weirder from here. Often several lines later another await statement would raise another GeneratorExit, such as writer.write() or even asyncio.sleep(). Doesn't matter whether I catch the additional GeneratorExit or not, once code exits this coroutine a RuntimeError('coroutine ignored GeneratorExit') is raised. And it doesn't matter what I do with this RuntimeError, the outermost coroutine's Task always generates an 'asyncio Task was destroyed but it is pending!' error message.
Taking a step back from this specific problem. Does a "casual" user of asyncio need to worry about handling GeneratorExits? Can I assume that I should not see GeneratorExits in user code?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39116>
_______________________________________
More information about the Python-bugs-list
mailing list