This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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: Mark.Shannon, nahco314, pablogsal
Priority: normal Keywords: patch

Created on 2021-09-14 04:56 by nahco314, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 28325 closed nahco314, 2021-09-14 08:49
PR 28753 open nahco314, 2021-10-06 08:27
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
2022-04-11 14:59:50adminsetgithub: 89354
2021-11-23 11:09:15pablogsalsetnosy: + Mark.Shannon
2021-11-23 10:32:06iritkatrielsetnosy: + pablogsal
2021-10-06 08:27:09nahco314setpull_requests: + pull_request27098
2021-09-14 08:49:39nahco314setkeywords: + patch
stage: patch review
pull_requests: + pull_request26736
2021-09-14 04:56:40nahco314create