New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semantics of PyCode_Addr2Line() changed #89127
Comments
I have noticed that the semantics of PyCode_Addr2Line() have changed from 3.9 to 3.10. Technically, the function was called with: PyCode_Addr2Line(frame->f_code, frame->f_last_i * 2) but now it needs to be called with PyCode_Addr2Line(frame->f_code, frame->f_last_i * 2) This is likely going to break all users of this function. This is also not advertised in the 3.10 "how to port to Python 3.10" section. We should discuss what's the best approach here because technically this is a backwards incompatible change, although in the other hand PyCode_Addr2Line() was not documented previously so we may have some room. We need to decide on this ASAP, because there is only one extra release candidate before the actual release of 3.10/ |
Sorry, bad copy paste. Correction: Technically, the function was called with: PyCode_Addr2Line(frame->f_code, frame->f_last_i) but now it needs to be called with PyCode_Addr2Line(frame->f_code, frame->f_last_i * 2) |
It is not If you call you get the same behavior as calling
Assuming the bytecode is unchanged. The difference is that for the nth instruction People should be using |
Are you ok if I add a small comment to the what's new of 3.10? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: