classification
Title: Traceback off by one line when
Type: Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, xtreak
Priority: normal Keywords:

Created on 2020-01-09 13:25 by facundobatista, last changed 2020-01-11 19:34 by facundobatista. This issue is now closed.

Messages (3)
msg359678 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2020-01-09 13:25
When using pdb to debug, the traceback is off by one line.

For example, this simple script:

```
print("line 1")
import pdb;pdb.set_trace()
print("line 2")
print("line 3", broken)
print("line 4")
```

...when run produces the following traceback (after hitting 'n' in pdb, of course):

```
Traceback (most recent call last):
  File "/home/facundo/foo.py", line 3, in <module>
    print("line 2")
NameError: name 'broken' is not defined
```
msg359691 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-01-09 18:52
This looks similar to issue35405 . See also issue16482 with a patch.
msg359819 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2020-01-11 19:34
This is a duplicate of https://bugs.python.org/issue16482 -- closing it.
History
Date User Action Args
2020-01-11 19:34:16facundobatistasetstatus: open -> closed
resolution: duplicate
messages: + msg359819

stage: resolved
2020-01-11 01:14:50terry.reedysetversions: - Python 3.6
2020-01-09 18:52:36xtreaksetnosy: + xtreak
messages: + msg359691
2020-01-09 13:25:48facundobatistacreate