Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parse crashes when raising tokenizer errors when an existing exception is set #88309

Closed
pablogsal opened this issue May 15, 2021 · 2 comments

Comments

@pablogsal
Copy link
Member

BPO 44143
Nosy @pablogsal, @miss-islington, @isidentical
PRs
  • bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set #26144
  • [3.10] bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144) #26148
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-05-15.17:40:42.710>
    created_at = <Date 2021-05-15.16:30:11.049>
    labels = []
    title = 'The parse crashes when raising tokenizer errors when an existing exception is set'
    updated_at = <Date 2021-05-15.17:40:42.710>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2021-05-15.17:40:42.710>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-05-15.17:40:42.710>
    closer = 'pablogsal'
    components = []
    creation = <Date 2021-05-15.16:30:11.049>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44143
    keywords = ['patch']
    message_count = 2.0
    messages = ['393716', '393722']
    nosy_count = 3.0
    nosy_names = ['pablogsal', 'miss-islington', 'BTaskaya']
    pr_nums = ['26144', '26148']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44143'
    versions = []

    @pablogsal
    Copy link
    Member Author

    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.

    @pablogsal
    Copy link
    Member Author

    New changeset 1afaaf5 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)
    1afaaf5

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant