classification
Title: Error.__traceback__.tb_lineno is wrong
Type: behavior Stage: patch review
Components: Interpreter Core Versions: Python 3.11, Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: nahco314
Priority: normal Keywords: patch

Created on 2021-09-14 04:56 by nahco314, last changed 2021-09-14 08:49 by nahco314.

Pull Requests
URL Status Linked Edit
PR 28325 open nahco314, 2021-09-14 08:49
Messages (1)
msg401748 - (view) Author: nahco314 (nahco314) * Date: 2021-09-14 04:56
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.
History
Date User Action Args
2021-09-14 08:49:39nahco314setkeywords: + patch
stage: patch review
pull_requests: + pull_request26736
2021-09-14 04:56:40nahco314create