classification
Title: The parse crashes when raising tokenizer errors when an existing exception is set
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2021-05-15 16:30 by pablogsal, last changed 2021-05-15 17:40 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26144 merged pablogsal, 2021-05-15 16:31
PR 26148 merged miss-islington, 2021-05-15 16:58
Messages (2)
msg393716 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-05-15 16:30
The parser currently crashes when raising exceptions when the error indicator set. Reproducer:

import ast
source = """\
[interesting
foo()
"""
print(repr(source))
compile(source, "", "exec")

We need to make sure to clean any existing exception before we raise or own.
msg393722 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-05-15 17:39
New changeset 1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3 by Miss Islington (bot) in branch '3.10':
bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144) (GH-26148)
https://github.com/python/cpython/commit/1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3
History
Date User Action Args
2021-05-15 17:40:42pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-05-15 17:39:25pablogsalsetmessages: + msg393722
2021-05-15 16:58:11miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request24784
2021-05-15 16:31:29pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request24780
2021-05-15 16:30:11pablogsalcreate