Opening the file as `r` instead or `rb` ensures that we don't have any implicit encoding/decoding of strings (so Python 3 is happy). Includes a test that passes on both Python 2 and Python 3 which checks this works correctly.