Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Crash report
In a--with-pydebug build, run the following code:
$ cat ~/tmp/t.pyimport astast.parse("""func( a=["unclosed], # Need a quote in this comment: " b=2,)""")$ ./python ~/tmp/t.pyError 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 in5c19050
| raise_unclosed_parentheses_error(p); |
What happened is that the_PyTokenizer_Get(p->tok, &new_token) call earlier also sets an errorhere.
Your environment
- CPython versions tested on: main branch at5c19050, 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