file.read Method Documentation (Python 2.7.10)

Chris Angelico rosuav at gmail.com
Mon Jan 9 13:25:07 EST 2023


On Tue, 10 Jan 2023 at 01:36, Stephen Tucker <stephen_tucker at sil.org> wrote:
>
> Dear Python-list,
>
> Yes, I know that Python 2.x is no longer supported.
>
> I have found that the documentation for this method is misleading when the
> file being read is UTF-8-encoded:
>
>    Instead of reading *size* bytes, the method reads *size *UTF-8 byte
> *sequences*.
>
> Has this error been corrected in the Python 3.x documentation?
>

What documentation is this? The builtin 'file' type doesn't know
anything about encodings, and only ever returns bytes.

ChrisA


More information about the Python-list mailing list