Cover cache file binary mode required in Python 3