You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-01-26.15:58:50.341>created_at=<Date2020-11-17.07:26:31.650>labels= ['3.8', 'type-bug', 'library', '3.9', '3.10']
title='Pdb does not correclty restart the target if it changes the current directory'updated_at=<Date2021-01-26.15:58:50.341>user='https://github.com/hexagonrecursion'
This was mentioned in bpo-31121, but I believe this deserves its own separate issue. If the debug target is specified using a relative path and later the current directory is changed, pdb tries to search for the target in the new current directory. This currently causes pdb to be unable to exit, which is what bpo-31121 and bpo-14743 are about, but even if they are fixed we would still be left with pdb exiting instead of restarting the target. This issues is about the latter.
$ mkdir foo
$ cat > foo/script.py
import os
os.chdir('foo')
$ python3 -m pdb foo/script.py
> /home/user/foo/script.py(1)<module>()
-> import os
(Pdb) c
The program finished and will be restarted
Traceback (most recent call last):
File "/usr/lib64/python3.8/pdb.py", line 1704, in main
pdb._runscript(mainpyfile)
File "/usr/lib64/python3.8/pdb.py", line 1570, in _runscriptwith io.open_code(filename) as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'foo/script.py'
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr/lib64/python3.8/pdb.py(1570)_runscript()
-> with io.open_code(filename) as fp:
New changeset 501d4a5 by Andrey Bienkowski in branch 'master': bpo-42383: pdb: do not fail to restart the target if the current directory changed (bpo-23412) 501d4a5
New changeset f8cfe54 by Andrey Bienkowski in branch '3.9':
[3.9] bpo-42383: pdb: do not fail to restart the target if the current directory changed (GH-23412) (bpo-24322) f8cfe54
New changeset d863dee by Andrey Bienkowski in branch '3.8':
[3.8] bpo-42383: pdb: do not fail to restart the target if the current directory changed (GH-23412) (bpo-24323) d863dee
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: