$ cat ~/tmp/t.py
import ast
ast.parse("""
func(
a=["unclosed], # Need a quote in this comment: "
b=2,
)
""")
$ ./python ~/tmp/t.py
python: Objects/call.c:324: _PyObject_Call: Assertion `!_PyErr_Occurred(tstate)' failed.
fish: Job 1, './python ~/tmp/t.py' terminated by signal SIGABRT (Abort)
Crash report
In a
--with-pydebugbuild, run the following code:Error messages
(How do I obtain a core dump?)
I think the error happens inside this call:
cpython/Parser/pegen_errors.c
Line 175 in 5c19050
What happened is that the
_PyTokenizer_Get(p->tok, &new_token)call earlier also sets an error here.Your environment
Linked PRs