CheckFile raises UnicodeDecodeError
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
latest build, python 3.3.3, windows 8.1
Pressing Ctrl+Shift+C invokes CheckFile. When the file being checked contains 0x90 UnicodeDecodeError: ... can't decode byte 0x90 ... is raised.
In the traceback I see:
File "C:\Python33\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 467, in CheckFile
code = f.read() + "\n"
I added encoding='utf-8' to the open for that file. The program now runs without error.
How do I submit a patch for it?
That's only going to work for files that actually are utf-8. If you open it in binary mode, the compile function should decode it acccording to the encoding declaration at the top of the file.
To create a patch, you'll need a program that can produce a unified diff.
(http://gnuwin32.sourceforge.net/packages/diffutils.htm is one such)