=doc #16134 read file as binary stream, because StreamReader expects binary

Also use `codecs.open` because [it is](https://docs.python.org/3/howto/pyporting.html#text-files) recommended for backwards compatibility.