-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Closed as not planned
Copy link
Labels
3.9only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The below code triggers the following exception message: SystemError: <class 'UnicodeDecodeError'> returned a result with an error set
. On later Python versions(>3.9), this shows up as just a UnicodeDecodeError
, so it seems like the issue does not occur in later versions. I tried checking to see if this was known to exist in version 3.9, but didn't see anything, so I am reporting it here. Note that the type_comments argument must be set to True
in order for this to occur.
Reproducer
import ast
d = b'def hello(*onRlionRRasR,#type:RR,rRBRliRRf, o:\n f, o:\n ionRleloionRRasR,#type:RR,rRBRl\x8fRRf, o:\n cRRRlction= la:::::\x1c:\xad\xa2"\n'
parseval1 = ast.parse(d, type_comments = True)
Trace
Traceback (most recent call last):
File "rep.py", line 5, in <module>
ast.parse(d, type_comments = True)
File "/usr/lib/python3.9/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
SystemError: <class 'UnicodeDecodeError'> returned a result with an error set
CPython versions tested on:
3.9
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
3.9only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error