[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2020-12-02 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-b

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, I do not know such workaround. At best, you can analyze the code object and get the line number of the next instruction. It may be the line past the last line of the function call, or be equal to it if the function call is the part of complex expressio

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Thomas Haller
Thomas Haller added the comment: > We could keep f_lineno unchanged, despite the fact that its value can be wrong It was not completely wrong. It was seemingly good enough for the past 20+ years. The change in behaviour is one thing. It's also inconvenient that, even when being aware of th

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, of course. We could keep f_lineno unchanged, despite the fact that its value can be wrong, and introduce f_lineno_new. Then we should change all code in the stdlib which uses f_lineno to use f_new_lineno, or rather, to keep absolute backward compatibi

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Thomas Haller
Thomas Haller added the comment: OK, I see. Thanks for the references. FWIW, I think such changes in behavior are really bad. The issue should be fixed without changing existing API. -- ___ Python tracker

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue12458 and issue34372. Related issues: issue34876, issue16806, issue31241. -- ___ Python tracker ___ _

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Thomas Haller
Thomas Haller added the comment: Do you have a reference to the discussion about that? -- ___ Python tracker ___ ___ Python-bugs-li

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Right, it is intended change. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Thomas Haller
Change by Thomas Haller : -- components: +Interpreter Core type: -> behavior versions: +Python 3.8 ___ Python tracker ___ ___ Pytho

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Thomas Haller
New submission from Thomas Haller : The line number for the frame object changed behaviour in 3.8. I am seeing this on Fedora rawhide, which ships "3.8.0~b4-1.fc32" package. That happens when wrapping lines for calling functions. Before, the line number sys._getframe(1).f_lineno indicate the