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
This is probably happening because ast27_parse_impl converts source from bytes to string and tries to parse it without caring about source code encoding comment.
PEP 263 says:
If a Unicode string with a coding declaration is passed to compile() , a SyntaxError will be raised.
I was trying to generate stubs for
sre_compile
and it fails with:This is probably happening because
ast27_parse_impl
converts source from bytes to string and tries to parse it without caring about source code encoding comment.PEP 263 says:
One quick fix would be to remove such comment from source before it is passed to
mypy.parse.parse()
in stubgen.py.I am wondering if this is worth fixing? If yes, is the above the best way to do it.
The text was updated successfully, but these errors were encountered: