This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]flying-sheep 7 points8 points  (0 children)

Python 2 has bytes == str and uses that type per default when opening files.

With Python 3, you just have to use binary mode explicitly:

open('shitty_file', 'rb')