Message179718
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`). |
|
Date |
User |
Action |
Args |
2013-01-11 18:22:02 | mjpieters | set | recipients:
+ mjpieters, docs@python |
2013-01-11 18:22:02 | mjpieters | set | messageid: <1357928522.67.0.838908652159.issue16937@psf.upfronthosting.co.za> |
2013-01-11 18:22:02 | mjpieters | link | issue16937 messages |
2013-01-11 18:22:01 | mjpieters | create | |
|