Repository navigation
[3.10] gh-93592: Fix frame chain when throwing exceptions into coroutines - #95207
Conversation
|
Please the PR against main branch and then it will be backported to older branches. Thanks! |
|
@kumaraditya303 PR doesn't apply to |
Right, re-opened Sorry for closing your PR, apparently the PR title did not contain [3.10] hence I closed it as we backport changes from main to older branches. |
|
@kristjanvalur You can add a news entry with https://blurb-it.herokuapp.com/ |
|
This has been sitting here for a bit. I wonder if we could request a review from someone else? |
|
Thanks @kristjanvalur. Would you mind porting the regression test to main, to make sure that this stays fixed? |
|
Not at all. I'll create a separate PR. |
Issue #93592 describes how a
coro.throw()will wake up the coroutine, but the frame chain is broken, making itimpossible to get a proper traceback. This impedes debuggers when they break on thrown exceptions, among other things.
The problem is observed in versions
3.7-3.10but is fixed in3.11, since there appears to have been structural changes made in frame objects in that version, and the necessary re-write of the generator code seems to have (accidentally?) fixed the issue.A regression tests is provided, which could also be applied to the
3.11andmainbranches.