Closed
Description
Crash report
In a --with-pydebug
build, run the following code:
$ cat ~/tmp/t.py import ast ast.parse(""" func( a=["unclosed], # Need a quote in this comment: " b=2, ) """) $ ./python ~/tmp/t.py
Error messages
python: Objects/call.c:324: _PyObject_Call: Assertion `!_PyErr_Occurred(tstate)' failed. fish: Job 1, './python ~/tmp/t.py' terminated by signal SIGABRT (Abort)
(How do I obtain a core dump?)
I think the error happens inside this call:
Line 175 in 5c19050
What happened is that the _PyTokenizer_Get(p->tok, &new_token)
call earlier also sets an error here.
Your environment
- CPython versions tested on: main branch at 5c19050, but this also happens since Python 3.10
- Operating system and architecture: Linux x86_64
Linked PRs
- gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer #100065
- [3.11] gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065) #100067
- [3.10] gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065) #100073