[issue31121] Unable to exit pdb when script becomes invalid

2020-11-16 Thread Andrey Bienkowski


Andrey Bienkowski  added the comment:

Another way to reproduce this that will continue to work once #42383 is fixed 
is to delete or move the script while it's being debugged.

--
nosy: +hexagonrecursion

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31121] Unable to exit pdb when script becomes invalid

2017-08-05 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +xdegaye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31121] Unable to exit pdb when script becomes invalid

2017-08-04 Thread Jason R. Coombs

New submission from Jason R. Coombs:

Similar to #16180 and possible a duplicate of #14743, if the script being run 
under pdb becomes invalid such as through a chdir operation, pdb will get 
trapped in a loop, catching its own exception.

$ mkdir foo
$ cat > foo/script.py
import os
os.chdir('foo')
$ python -m pdb foo/script.py
> /Users/jaraco/Dropbox/code/privacymate/harvester/foo/script.py(1)()
-> import os
(Pdb) c
The program finished and will be restarted
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py", line 
1667, in main
pdb._runscript(mainpyfile)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py", line 
1545, in _runscript
with open(filename, "rb") 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
> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py(1545)_runscript()
-> with open(filename, "rb") as fp:
(Pdb) q
Post mortem debugger finished. The foo/script.py will be restarted
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py", line 
1667, in main
pdb._runscript(mainpyfile)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py", line 
1545, in _runscript
with open(filename, "rb") 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
> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py(1545)_runscript()
-> with open(filename, "rb") as fp:
(Pdb) q
Post mortem debugger finished. The foo/script.py will be restarted
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py", line 
1667, in main
pdb._runscript(mainpyfile)
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py", line 
1545, in _runscript
with open(filename, "rb") 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
> /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pdb.py(1545)_runscript()
-> with open(filename, "rb") as fp:
(Pdb)

I suggest PDB should always pass exceptions when the stack trace terminates in 
the pdb module.

--
components: Library (Lib)
messages: 299748
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: Unable to exit pdb when script becomes invalid
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com