[Python-Dev] Help to fix this bug http://bugs.python.org/issue15068

Serhiy Storchaka storchaka at gmail.com
Tue Jun 19 16:28:28 CEST 2012


On 19.06.12 15:13, Antoine Pitrou wrote:
>>>> sys.stdin
> <_io.TextIOWrapper name='<stdin>' mode='r' encoding='UTF-8'>
>
> So it's a TextIOWrapper from the _io module (which is really the
> implementation of the io module). You'll find its source in
> Modules/_io. TextIOWrapper objects are defined in Modules/_io/textio.c.
> But as you know, they wrap buffered I/O objects, which are defined in
> Modules/_io/bufferedio.c. In sys.stdin's case, the buffered I/O object
> wraps a raw FileIO object, defined in Modules/_io/fileio.c:
>
>>>> sys.stdin.buffer
> <_io.BufferedReader name='<stdin>'>
>>>> sys.stdin.buffer.raw
> <_io.FileIO name='<stdin>' mode='rb'>

And don't forget about _pyio module.



More information about the Python-Dev mailing list