This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mjpieters
Recipients docs@python, mjpieters
Date 2013-01-11.18:22:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357928522.67.0.838908652159.issue16937@psf.upfronthosting.co.za>
In-reply-to
Content
Run `python3.3 -h` and the `-u` option is documented as:

>     -u     : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x
>              see man page for details on internal buffering relating to '-u'

Note that only `stdout` and `stderr` are mentioned.

The online documentation at http://docs.python.org/3/using/cmdline.html#cmdoption-u doesn't agree:

> ... the binary layer of the stdin, stdout and stderr streams ...

nor does `man python3.3`, which claims:

>    -u     Force the binary I/O layers of stdin, stdout and stderr to be unbuffered.  The text I/O layer will still
>           be line-buffered.

So, is `stdin` going to be unbuffered, or not, when using `-u`?

Running a simple test shows that `stdin` is firmly being buffered regardless of the `-u` switch:

    $ python3.3 -c 'import sys; print(sys.stdin.buffer, sys.stdout.buffer)'
    <_io.BufferedReader name='<stdin>'> <_io.BufferedWriter name='<stdout>'>
    $ python3.3 -u -c 'import sys; print(sys.stdin.buffer, sys.stdout.buffer)'
    <_io.BufferedReader name='<stdin>'> <_io.FileIO name='<stdout>' mode='wb'>

I'll presume here that `stdin` is deliberately buffered, regardless, and that the documentation and man page are out of date here (in python 2, `-u` does include `stdin`).
History
Date User Action Args
2013-01-11 18:22:02mjpieterssetrecipients: + mjpieters, docs@python
2013-01-11 18:22:02mjpieterssetmessageid: <1357928522.67.0.838908652159.issue16937@psf.upfronthosting.co.za>
2013-01-11 18:22:02mjpieterslinkissue16937 messages
2013-01-11 18:22:01mjpieterscreate