
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2012-10-09 19:33 byxdegaye, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pdbloopfix.diff | terry.reedy,2015-09-04 18:19 | review | ||
| pdb_syntax_error.patch | xdegaye,2015-09-05 10:08 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg172508 -(view) | Author: Xavier de Gaye (xdegaye)*![]() | Date: 2012-10-09 19:33 | |
$ tmp=`mktemp /tmp/foo.XXXXXXXXXX`; echo 'def foo: pass' > $tmp; python3 -m pdb $tmp; rm $tmpTraceback (most recent call last): File "/usr/local/lib/python3.2/pdb.py", line 1556, in main pdb._runscript(mainpyfile) File "/usr/local/lib/python3.2/pdb.py", line 1437, in _runscript self.run(statement) File "/usr/local/lib/python3.2/bdb.py", line 392, in run exec(cmd, globals, locals) File "<string>", line 1, in <module> File "/tmp/foo.iLhPYHBZrF", line 1 def foo: pass ^SyntaxError: invalid syntaxUncaught exception. Entering post mortem debuggingRunning 'cont' or 'step' will restart the program> <string>(1)<module>()(Pdb) quitPost mortem debugger finished. The /tmp/foo.iLhPYHBZrF will be restartedTraceback (most recent call last): File "/usr/local/lib/python3.2/pdb.py", line 1556, in main pdb._runscript(mainpyfile) File "/usr/local/lib/python3.2/pdb.py", line 1437, in _runscript self.run(statement) File "/usr/local/lib/python3.2/bdb.py", line 392, in run exec(cmd, globals, locals) File "<string>", line 1, in <module> File "/tmp/foo.iLhPYHBZrF", line 1 def foo: pass ^SyntaxError: invalid syntaxUncaught exception. Entering post mortem debuggingRunning 'cont' or 'step' will restart the program> <string>(1)<module>()(Pdb) --KeyboardInterrupt--(Pdb) | |||
| msg175970 -(view) | Author: rurpy (rurpy2) | Date: 2012-11-19 21:54 | |
This continues to be a problem on Python-3.3.0 | |||
| msg176274 -(view) | Author: Xavier de Gaye (xdegaye)*![]() | Date: 2012-11-24 10:49 | |
See how this is fixed athttp://code.google.com/p/pdb-clone/source/detail?r=0d4d905c6e0aa9c47611dbae514d3f7f53776dcb | |||
| msg249797 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2015-09-04 17:49 | |
Reported again in#24957Xavier, your link is out of date. | |||
| msg249802 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2015-09-04 18:19 | |
Simple fix attached. I copied the exit code from this part of the 'while True:' loop. try: pdb._runscript(mainpyfile) if pdb._user_requested_quit: break print("The program finished and will be restarted")I am not sure if the conditional is still needed there.Xavier, if you have a better patch, please upload it. | |||
| msg249900 -(view) | Author: Xavier de Gaye (xdegaye)*![]() | Date: 2015-09-05 10:08 | |
Slightly better in that pdb exits in case of a syntax error instead of proposing to restart the program which does not make sense.A test case is included. | |||
| msg249949 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-09-05 23:19 | |
New changeset26c4db1a0aea by Terry Jan Reedy in branch '2.7':Issue#16180: Exit pdb if file has syntax error, instead of trapping userhttps://hg.python.org/cpython/rev/26c4db1a0aeaNew changeset2d4aac2ab253 by Terry Jan Reedy in branch '3.4':Issue#16180: Exit pdb if file has syntax error, instead of trapping userhttps://hg.python.org/cpython/rev/2d4aac2ab253 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:37 | admin | set | github: 60384 |
| 2015-09-05 23:20:31 | terry.reedy | set | status: open -> closed resolution: fixed stage: test needed -> resolved |
| 2015-09-05 23:19:05 | python-dev | set | nosy: +python-dev messages: +msg249949 |
| 2015-09-05 10:09:00 | xdegaye | set | files: +pdb_syntax_error.patch messages: +msg249900 |
| 2015-09-04 18:19:06 | terry.reedy | set | files: +pdbloopfix.diff keywords: +patch messages: +msg249802 |
| 2015-09-04 17:50:44 | terry.reedy | link | issue24957 superseder |
| 2015-09-04 17:49:44 | terry.reedy | set | versions: + Python 2.7, Python 3.4, Python 3.5, Python 3.6, - Python 3.3 nosy: +georg.brandl,terry.reedy messages: +msg249797 stage: test needed |
| 2012-12-05 11:08:21 | asvetlov | set | nosy: +asvetlov |
| 2012-11-24 10:49:13 | xdegaye | set | messages: +msg176274 |
| 2012-11-19 21:54:52 | rurpy2 | set | nosy: +rurpy2 messages: +msg175970 versions: + Python 3.3, - Python 3.2 |
| 2012-10-09 19:33:24 | xdegaye | create | |