[New-bugs-announce] [issue46215] Wrong error line after using pdb

beda pišl report at bugs.python.org
Fri Dec 31 15:46:44 EST 2021


New submission from beda pišl <bedapisl at gmail.com>:

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.

----------
components: Library (Lib)
messages: 409434
nosy: bedapisl
priority: normal
severity: normal
status: open
title: Wrong error line after using pdb
type: behavior
versions: Python 3.9

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


More information about the New-bugs-announce mailing list