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 scoder
Recipients Mark.Shannon, nedbat, scoder
Date 2022-02-25.09:09:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645780156.83.0.425398755876.issue46389@roundup.psfhosted.org>
In-reply-to
Content
Possibly also related, so I though I'd mention it here (sorry if this is hijacking the ticket, seems difficult to tell). We're also seeing None values in f_lineno in Cython's test suite with 3.11a5:

      File "<doctest line_trace.run_trace[2]>", line 1, in <module>
        run_trace(py_add, 1, 2)
        ^^^^^^^^^^^^^^^^^^^^^^^
      File "tests/run/line_trace.pyx", line 231, in line_trace.run_trace (line_trace.c:7000)
        func(*args)
      File "tests/run/line_trace.pyx", line 60, in line_trace.trace_trampoline (line_trace.c:3460)
        raise
      File "tests/run/line_trace.pyx", line 54, in line_trace.trace_trampoline (line_trace.c:3359)
        result = callback(frame, what, arg)
      File "tests/run/line_trace.pyx", line 81, in line_trace._create_trace_func._trace_func (line_trace.c:3927)
        trace.append((map_trace_types(event, event), frame.f_lineno - frame.f_code.co_firstlineno))
    TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

https://github.com/cython/cython/blob/7ab11ec473a604792bae454305adece55cd8ab37/tests/run/line_trace.pyx

No generator expressions involved, though. (Much of that test was written while trying to get the debugger in PyCharm to work with Cython compiled modules.)

There is a chance that Cython is doing something wrong in its own line tracing code, obviously.
(I also remember seeing other tracing issues before, where the line reported was actually in the trace function itself rather than the code to be traced. We haven't caught up with the frame-internal changes yet.)
History
Date User Action Args
2022-02-25 09:09:16scodersetrecipients: + scoder, nedbat, Mark.Shannon
2022-02-25 09:09:16scodersetmessageid: <1645780156.83.0.425398755876.issue46389@roundup.psfhosted.org>
2022-02-25 09:09:16scoderlinkissue46389 messages
2022-02-25 09:09:16scodercreate