-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retype doesn't check source encodings before parsing #2
Comments
This line doesn't set an encoding when reading the file, which means that it defaults to a platform specific encoding. On Windows (10), this is
However, it is also possible for users to define their own source encoding using a comment syntax as defined in PEP 263. So it seems that in an ideal world, retype would determine the encoding from these PEP 263 comment lines, defaulting to UTF-8. |
I was trying to retype a file, but the file had a comment that contained Unicode characters.
Example file (core.py):
Example stub (types/core.pyi):
I would have expected it to not crash on files with Unicode characters, especially since the characters are within comments.
Tested using:
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
The text was updated successfully, but these errors were encountered: