pickle requires a file open in binary mode