Ensure that we open files in binary mode.
Merge pull request #2074 from Lukasa/filedoc

Ensure that we open files in binary mode in the docs.