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: Wrong error line after using pdb
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bedapisl
Priority: normal Keywords:

Created on 2021-12-31 20:46 by bedapisl, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg409434 - (view) Author: beda pišl (bedapisl) Date: 2021-12-31 20:46
Consider simple script:
```
for i in range(1):
    import pdb
    pdb.set_trace()

x = y + z
```
After running it and pressing 'c' to continue:

```
test$ python test.py
> /Users/bedrich.pisl/test/test.py(1)<module>()
-> for i in range(1):
(Pdb) c
```
I get error, but with wrong error line
```
Traceback (most recent call last):
  File "/Users/bedrich.pisl/test/test.py", line 1, in <module>
    for i in range(1):
NameError: name 'y' is not defined
```
The error is actually on line 5 not 1.
msg409452 - (view) Author: beda pišl (bedapisl) Date: 2022-01-01 09:48
I tried this on current main branch, and I cannot reproduce the problem there.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90373
2022-01-01 09:48:30bedapislsetstatus: open -> closed

messages: + msg409452
stage: resolved
2021-12-31 20:46:44bedapislcreate