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 Mark.Shannon
Recipients Mark.Shannon
Date 2021-01-04.16:32:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-01-04 16:32:45Mark.Shannonsetrecipients: + Mark.Shannon
2021-01-04 16:32:45Mark.Shannonsetmessageid: <1609777965.06.0.667792191004.issue42823@roundup.psfhosted.org>
2021-01-04 16:32:45Mark.Shannonlinkissue42823 messages
2021-01-04 16:32:44Mark.Shannoncreate