[New-bugs-announce] [issue45191] Error.__traceback__.tb_lineno is wrong

nahco314 report at bugs.python.org
Tue Sep 14 00:56:40 EDT 2021


New submission from nahco314 <nahco3_ta at yahoo.co.jp>:

I think that the emphasis of the errors caused by some of these equivalent expressions is wrong or inconsistent.
expr1: 1 .bit_length("aaa")
expr2: 1 \
    .bit_length("aaa")
expr3: 1 \
    .bit_length(*["aaa"])

Below is the __traceback__.tb_lineno of the error given when running each version of the expression. (kubuntu20.0.4, CPython (pyenv))
The line number and location shown in the error message also correspond to this.

in 3.6.14, 3,7,11
expr1: 0
expr2: 1
expr3: 1

in 3.8.11, 3.9.6
expr1: 0
expr2: 0
expr3: 0

in 3.10.0rc1, 3.11-dev(3.11.0a0)
expr1: 0
expr2: 1
expr3: 0

I think the results in 3.6.14 and 3.7.11 are correct.

----------
components: Interpreter Core
messages: 401748
nosy: nahco314
priority: normal
severity: normal
status: open
title: Error.__traceback__.tb_lineno is wrong
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45191>
_______________________________________


More information about the New-bugs-announce mailing list