You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compile() passes rest of file as SyntaxError().text when file unreadable #84799
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=Noneclosed_at=<Date2020-05-14.20:12:11.638>created_at=<Date2020-05-14.03:57:30.165>labels= ['type-bug', '3.9']
title='compile() passes rest of file as SyntaxError().text when file unreadable'updated_at=<Date2020-05-14.20:12:11.637>user='https://github.com/gvanrossum'
Activity
gvanrossum commentedon May 14, 2020
Example:
Note that the input is
pass
(1+)
pass
The second "pass" (and in fact the entire file) leaks into the SyntaxError object's text attribute.
This only happens when the file (here "<string>") cannot be read.
It's not specific to compile(), it seems fundamental in the C-level pegen API.
pablogsal commentedon May 14, 2020
New changeset bcc3036 by Pablo Galindo in branch 'master':
bpo-40619: Correctly handle error lines in programs without file mode (GH-20090)
bcc3036