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 2022-03-04.11:41:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646394111.96.0.0115707734127.issue46911@roundup.psfhosted.org>
In-reply-to
Content
This is a bit of a tricky one.

The problem is that the line number for an instruction is used for two purposes.
1. To calculate the line number in frame.f_lineno for tracebacks and events
2. By dis to determine which lines are present and where they start.

If we set the lineno for the initial RESUME instruction in a module, we break dis and coverage for modules that do not have code on line 1.

If we add an explicit line-start table, we would be able to fix this, as the RESUME would have a line number for case 1, but wouldn't start a line, thus not breaking dis.

An explicit line-start table has other advantages, so we probably will implement it, but maybe not until 3.12.

Ned,
Would it make sense in coverage.py to ignore "call" events when doing coverage, and only use "line" events?
All the traces in your example are from "call" events.
History
Date User Action Args
2022-03-04 11:41:51Mark.Shannonsetrecipients: + Mark.Shannon, nedbat
2022-03-04 11:41:51Mark.Shannonsetmessageid: <1646394111.96.0.0115707734127.issue46911@roundup.psfhosted.org>
2022-03-04 11:41:51Mark.Shannonlinkissue46911 messages
2022-03-04 11:41:51Mark.Shannoncreate