classification
Title: Parser does not handle correctly some errors when parsin from stdin
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lys.nikolaou, pablogsal, pmpp
Priority: normal Keywords: patch

Created on 2021-03-05 17:22 by pablogsal, last changed 2021-03-14 03:39 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24763 merged pablogsal, 2021-03-05 17:25
Messages (4)
msg388157 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-03-05 17:22
The parser crashes when there are some syntax errors from stdin:

> echo "(1+34"  | ./python.exe -
[1]    54046 done                echo "(1+34" |
       54047 segmentation fault  ./python.exe -
msg388159 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-03-05 17:33
I think we should look into having some variable holding all the text that we have parsed so far. All the workarounds to fetch the text from the file or from stdin or whatnot are getting very very complicated.
msg388172 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-03-05 23:47
I modified PR 24763 to implement this idea.
msg388654 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-03-14 03:38
New changeset cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a by Pablo Galindo in branch 'master':
bpo-43410: Fix crash in the parser when producing syntax errors when reading from stdin (GH-24763)
https://github.com/python/cpython/commit/cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a
History
Date User Action Args
2021-03-14 03:39:08pablogsalsetstatus: open -> closed
resolution: fixed
stage: resolved
2021-03-14 03:38:55pablogsalsetmessages: + msg388654
2021-03-05 23:47:26pablogsalsetmessages: + msg388172
2021-03-05 17:46:34pmppsetnosy: + pmpp
2021-03-05 17:33:23pablogsalsetmessages: + msg388159
stage: patch review -> (no value)
2021-03-05 17:25:21pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23535
2021-03-05 17:22:35pablogsalcreate