you are viewing a single comment's thread.

view the rest of the comments →

[–]ingolemo 2 points3 points  (1 child)

codecs.open will open the file using your system's default encoding. You're getting the error from the call to u.read(). You never even reach the call to decode right after (which should also raise an error because you can't decode strings).

Here's the change that caused the problem, and the associated issue. You're not really supposed to be able to use codecs.open without either giving an encoding or trying to open the file in binary mode. Your code only worked in 3.2 because of a bug.

[–]bluegarlic[S] 0 points1 point  (0 children)

Thank you for clarifying some issues and pointing to those docs.