[New-bugs-announce] [issue45848] Pegen's nice error reporting crashes non-UTF-8 files

Petr Viktorin report at bugs.python.org
Fri Nov 19 12:46:25 EST 2021


New submission from Petr Viktorin <encukou at gmail.com>:

Parsing a script with non-UTF-8 encoding and a missing close parenthesis, like a file with the following 2 lines:

# encoding: ascii
(

... crashes with:

python: Parser/pegen.c:408: get_error_line: Assertion `p->tok->fp == NULL || p->tok->fp == stdin' failed.
Aborted (core dumped)

----------
components: Parser
files: missing_paren_ascii.py
messages: 406602
nosy: lys.nikolaou, pablogsal, petr.viktorin
priority: normal
severity: normal
status: open
title: Pegen's nice error reporting crashes non-UTF-8 files
Added file: https://bugs.python.org/file50451/missing_paren_ascii.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45848>
_______________________________________


More information about the New-bugs-announce mailing list