#667 CheckFile raises UnicodeDecodeError

v1.0 (example)
bob gailer

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"


  • bob gailer

    bob gailer - 2014-03-31

    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?

    • Roger Upole

      Roger Upole - 2014-04-03

      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)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks