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, nedbat
Date 2021-01-06.13:29:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609939781.16.0.96509898455.issue42823@roundup.psfhosted.org>
In-reply-to
Content
It looks like you are accessing the c field "f_lineno" directly.
That was never guaranteed to work, it just happened to.
You should use PyFrame_GetLineNumber()
If "f_lineno" is up to date, then it will be almost efficient as the direct field access (the overhead is a C call).
If "f_lineno" is not up to date, PyFrame_GetLineNumber() will compute the correct value.

In the interest of efficiency it makes sense that the internal f_line field is updated before CALL and RETURN trace events.
I'll make that change, but you really ought to use the API rather than probing into the frame internals.
History
Date User Action Args
2021-01-06 13:29:41Mark.Shannonsetrecipients: + Mark.Shannon, nedbat
2021-01-06 13:29:41Mark.Shannonsetmessageid: <1609939781.16.0.96509898455.issue42823@roundup.psfhosted.org>
2021-01-06 13:29:41Mark.Shannonlinkissue42823 messages
2021-01-06 13:29:40Mark.Shannoncreate