Author FFY00
Recipients FFY00, Mark.Shannon, graingert, iritkatriel, nedbat
Date 2021-06-18.00:03:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623974593.14.0.863810923606.issue44446@roundup.psfhosted.org>
In-reply-to
Content
Upon further investigation, there are actually two issues here. The first would be the one I identified already, traceback.FrameSummary not being prepared for lineno being None, but there is also a regression in lineno being invalid in this situation in the first place.

With only GH-26781, the traceback will look like the following:


  File "/home/anubis/git/cpython/rep.py", line 13, in <module>
    next(bar().__await__(), None)
  File "/home/anubis/git/cpython/rep.py", line 10, in bar
    return [chunk async for chunk in foo()]
  File "/home/anubis/git/cpython/rep.py", line None, in <listcomp>
  File "/home/anubis/git/cpython/rep.py", line 6, in foo
    traceback.print_stack()
working!


which is different from 3.9



  File "/home/anubis/git/cpython/rep.py", line 13, in <module>
    next(bar().__await__(), None)
  File "/home/anubis/git/cpython/rep.py", line 10, in bar
    return [chunk async for chunk in foo()]
  File "/home/anubis/git/cpython/rep.py", line 10, in <listcomp>
    return [chunk async for chunk in foo()]
  File "/home/anubis/git/cpython/rep.py", line 6, in foo
    traceback.print_stack()
working!


I bisected the second issue to b37181e69209746adc2119c471599a1ea5faa6c8 which moves generators to bytecode, and when doing so changes the behavior to set lineno to -1. I have opened a GH-26782 to fixing this.
History
Date User Action Args
2021-06-18 00:03:13FFY00setrecipients: + FFY00, nedbat, Mark.Shannon, graingert, iritkatriel
2021-06-18 00:03:13FFY00setmessageid: <1623974593.14.0.863810923606.issue44446@roundup.psfhosted.org>
2021-06-18 00:03:13FFY00linkissue44446 messages
2021-06-18 00:03:12FFY00create