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
frame.f_lineno doesn't get updated after local trace function assigned to it #51487
Comments
As you can see, when a local trace function sets f_lineno, f_lineno 13 The reference manual (for python 2.6) states the following: "f_lineno is |
It's not a bug. What happens is like this: 1, You set trace function using sys.settrace(tracer). Here because your frame's local trace function is not executed, the f_lineno is not refreshed. 4, When the second time func() calls, there is no global trace function. Each time you get the f_lineno, it uses PyCode_Addr2Line() to get the dynamically computed line number. I think this situation is so rarely that the doc saying "f_lineno is |
See also the related bpo-16482. |
I am unable to reproduce this on 3.11, I get this: iritkatriel@Irits-MBP cpython % ./python.exe tracer_testcase.py 14 I am also unable to reproduce the problem in the related bpo-16482. |
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: