Fix opening binary files under Py3k (thanks to Dominic Fitzpatrick).