Author kinow
Recipients ammar2, kinow, serhiy.storchaka
Date 2019-07-22.06:45:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563777926.0.0.881189372733.issue37647@roundup.psfhosted.org>
In-reply-to
Content
Hi Ammar, thanks for the quick reply and for the suggestion.

Tried on the latest version on master, and looks like it's indeed different, though still looks like it is displaying the wrong line number.

```
kinow@localhost:~/Development/python/workspace/cpython$ python
Python 3.9.0a0 (heads/master:b530a4460b, Jul 22 2019, 18:38:44) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
kinow@localhost:~/Development/python/workspace/cpython$ python z.py
Traceback (most recent call last):
  File "/home/kinow/Development/python/workspace/cpython/z.py", line 14, in <module>
    print(list(raise_generator()))
  File "/home/kinow/Development/python/workspace/cpython/z.py", line 7, in raise_generator
    yield 'three values are: %s %s %s' % (
  File "/home/kinow/Development/python/workspace/cpython/z.py", line 3, in __str__
    raise ValueError('Z error')
ValueError: Z error
```

It is now displaying the line number 7, where the yield statement begins, instead of where it actually happened (line 9).

And once again, if I replace `Z()` by `Z().__str__()`, then it displays the right line number.

```
kinow@localhost:~/Development/python/workspace/cpython$ python z.py
Traceback (most recent call last):
  File "/home/kinow/Development/python/workspace/cpython/z.py", line 14, in <module>
    print(list(raise_generator()))
  File "/home/kinow/Development/python/workspace/cpython/z.py", line 9, in raise_generator
    Z().__str__(),  # traceback must point to this lineno 9
  File "/home/kinow/Development/python/workspace/cpython/z.py", line 3, in __str__
    raise ValueError('Z error')
ValueError: Z error
```
History
Date User Action Args
2019-07-22 06:45:26kinowsetrecipients: + kinow, serhiy.storchaka, ammar2
2019-07-22 06:45:26kinowsetmessageid: <1563777926.0.0.881189372733.issue37647@roundup.psfhosted.org>
2019-07-22 06:45:25kinowlinkissue37647 messages
2019-07-22 06:45:25kinowcreate