read text file byte by byte

sjdevnull at yahoo.com sjdevnull at yahoo.com
Tue Dec 15 12:10:38 EST 2009


On Dec 14, 11:44 pm, Terry Reedy <tjre... at udel.edu> wrote:
> On 12/14/2009 7:37 PM, Gabriel Genellina wrote:
>
>
>
> > En Mon, 14 Dec 2009 18:09:52 -0300, Nobody <nob... at nowhere.com> escribió:
> >> On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn... at yahoo.com wrote:
>
> >>> The 3.1 documentation specifies that file.read returns bytes:
>
> >>> Does it need fixing?
>
> >> There are no file objects in 3.x. The file() function no longer
> >> exists. The return value from open(), will be an instance of
> >> _io.<something> depending upon the mode, e.g. _io.TextIOWrapper for 'r',
> >> _io.BufferedReader for 'rb', _io.BufferedRandom for 'w+b', etc.
>
> >>http://docs.python.org/3.1/library/io.html
>
> >> io.IOBase.read() doesn't exist, io.RawIOBase.read(n) reads n bytes,
> >> io.TextIOBase.read(n) reads n characters.
>
> > So basically this section [1] should not exist, or be completely rewritten?
> > At least the references to C stdio library seem wrong to me.
>
> > [1]http://docs.python.org/3.1/library/stdtypes.html#file-objects
>
> I agree.http://bugs.python.org/issue7508
>
> Terry Jan Reedy

Thanks, Terry.



More information about the Python-list mailing list