Author twisteroid ambassador
Recipients asvetlov, salgado, twisteroid ambassador, yselivanov
Date 2020-10-19.08:07:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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?
Date User Action Args
2020-10-19 08:07:48twisteroid ambassadorsetrecipients: + twisteroid ambassador, asvetlov, salgado, yselivanov
2020-10-19 08:07:48twisteroid ambassadorsetmessageid: <>
2020-10-19 08:07:48twisteroid ambassadorlinkissue39116 messages
2020-10-19 08:07:48twisteroid ambassadorcreate