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 tvoinarovskyi
Recipients asvetlov, tvoinarovskyi, yselivanov
Date 2019-01-16.10:34:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547634847.81.0.0050263541371.issue35751@roundup.psfhosted.org>
In-reply-to
Content
My use case:
I have a background task, say called "coordination". In that task, I want to catch any errors and push those to the user waiting in the main task and only continue running the background coroutine after the user manually resolves the exception. 

Issue:
When testing the behaviour with ``unittest.Case`` and using ``assertRaises`` to catch the exception, the background coroutine manages to just freeze. I have narrowed it down to ``traceback.clear_frames`` in ``assertRaises`` that causes a GeneratorExit in the background coroutine.

I believe this issue is a duplicate to https://bugs.python.org/issue29211, but wanted to provide another actual use case where it can pop up. Also even if the generator raises a GeneratorExit, why did the background thread freeze is still a mystery to me.

Script to reproduce in my case is attached.
History
Date User Action Args
2019-01-16 10:34:09tvoinarovskyisetrecipients: + tvoinarovskyi, asvetlov, yselivanov
2019-01-16 10:34:07tvoinarovskyisetmessageid: <1547634847.81.0.0050263541371.issue35751@roundup.psfhosted.org>
2019-01-16 10:34:07tvoinarovskyilinkissue35751 messages
2019-01-16 10:34:07tvoinarovskyicreate