New submission from Kerrick Staley <kerr...@kerrickstaley.com>:

Summary:
When you call ast.literal_eval on a string that does not contain valid Python 
code, it raises a SyntaxError. This causes pdb to exit instead of stopping 
execution at the point that the SyntaxError was raised.

To reproduce:
1. Create a Python file foo.py with these contents:

    import ast
    ast.literal_eval('')

2. Run python -m pdb foo.py
3. Type 'c' and hit enter.

Expected behavior:
pdb drops into a shell in ast.py at the point where the SyntaxError occurred.

Actual behavior:
The program exits, and a SyntaxError traceback is displayed.

System configuration:
Python 3.8.2 on Arch Linux.

----------
components: Library (Lib)
messages: 367363
nosy: Kerrick Staley
priority: normal
severity: normal
status: open
title: pdb does not drop into debugger upon SyntaxError caused by 
ast.literal_eval
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40403>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to