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, scoder
Date 2022-02-25.11:56:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645790219.18.0.781031936942.issue46389@roundup.psfhosted.org>
In-reply-to
Content
Stefan,

f_lineno can be None for some opcodes, but there shouldn't be trace events if it is.

E.g.
>>> def f():
...     try:
...          1/0
...     finally:
...          pass
...

>>> list(f.__code__.co_lines())
[(0, 2, 1), (2, 4, 2), (4, 12, 3), (12, 16, 5), (16, 18, None), (18, 26, 5)]

Note that the bytecode at offset 16 has no line number, but there should be no events for it.


BUT, before you try and fix your tracing emulation, I repeat my plea.

Please stop trying to mimic CPython internals, and ask for the APIs that you need.
History
Date User Action Args
2022-02-25 11:56:59Mark.Shannonsetrecipients: + Mark.Shannon, scoder, nedbat
2022-02-25 11:56:59Mark.Shannonsetmessageid: <1645790219.18.0.781031936942.issue46389@roundup.psfhosted.org>
2022-02-25 11:56:59Mark.Shannonlinkissue46389 messages
2022-02-25 11:56:59Mark.Shannoncreate