Message384331
The logic for frame.f_lineno assumes that the internal C field will be updated when f_trace is set, but that is incorrect.
Consequently, the following code
import sys
def print_line():
print(sys._getframe(1).f_lineno)
def test():
print_line()
sys._getframe(0).f_trace = True
print_line()
print_line()
test()
prints
7
8
8
it should print
7
9
10
Fixing this is required by PEP 626, but it should be fixed anyway. |
|
Date |
User |
Action |
Args |
2021-01-04 16:32:45 | Mark.Shannon | set | recipients:
+ Mark.Shannon |
2021-01-04 16:32:45 | Mark.Shannon | set | messageid: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org> |
2021-01-04 16:32:45 | Mark.Shannon | link | issue42823 messages |
2021-01-04 16:32:44 | Mark.Shannon | create | |
|