Message368815
Example:
>>> compile("pass\n(1+)\npass", "<string>", "exec")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "", line 2
(1+)
pass
^
SyntaxError: invalid syntax
>>>
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. |
|
Date |
User |
Action |
Args |
2020-05-14 03:57:30 | gvanrossum | set | recipients:
+ gvanrossum |
2020-05-14 03:57:30 | gvanrossum | set | messageid: <1589428650.19.0.472919567451.issue40619@roundup.psfhosted.org> |
2020-05-14 03:57:30 | gvanrossum | link | issue40619 messages |
2020-05-14 03:57:29 | gvanrossum | create | |
|