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 chris.jerdonek
Recipients BTaskaya, aeros, asvetlov, carltongibson, chris.jerdonek, eamanu, felixxm, yselivanov
Date 2020-05-21.09:28:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590053325.89.0.988261239971.issue40696@roundup.psfhosted.org>
In-reply-to
Content
I just posted a draft PR that implements the narrower fix:
https://github.com/python/cpython/pull/20287
I confirmed that the Django test passes with it. I also included two regression tests: one using only generators, and one more like the Django test that awaits a task.

My solution was to update the exception context in gen_send_ex() using _PyErr_SetObject() instead of _PyErr_ChainExceptions() -- because _PyErr_SetObject() does the cycle detection we've been discussing, and _PyErr_ChainExceptions() doesn't.

While _PyErr_SetObject()'s cycle detection isn't complete in that it can't detect cycles that begin further down the chain, it's good enough for this case.
History
Date User Action Args
2020-05-21 09:28:45chris.jerdoneksetrecipients: + chris.jerdonek, asvetlov, yselivanov, eamanu, BTaskaya, aeros, carltongibson, felixxm
2020-05-21 09:28:45chris.jerdoneksetmessageid: <1590053325.89.0.988261239971.issue40696@roundup.psfhosted.org>
2020-05-21 09:28:45chris.jerdoneklinkissue40696 messages
2020-05-21 09:28:45chris.jerdonekcreate