Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61b0c67

Browse files
committed
#16937: document that stdin is always buffered, even when -u is used. Patch by Elena Oat.
1 parent 72f562f commit 61b0c67

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

Doc/using/cmdline.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ Miscellaneous options
269269

270270
.. cmdoption:: -u
271271

272-
Force the binary layer of the stdin, stdout and stderr streams (which is
273-
available as their ``buffer`` attribute) to be unbuffered. The text I/O
272+
Force the binary layer of the stdout and stderr streams (which is
273+
available as their ``buffer`` attribute) to be unbuffered. The text I/O
274274
layer will still be line-buffered if writing to the console, or
275275
block-buffered if redirected to a non-interactive file.
276276

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ Tim O'Malley
896896
Zooko O'Whielacronx
897897
Aaron Oakley
898898
James Oakley
899+
Elena Oat
899900
Jon Oberheide
900901
Pascal Oberndoerfer
901902
Jeffrey Ollie

Misc/python.man

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ that it entails. Also disable these manipulations if
172172
is explicitly imported later.
173173
.TP
174174
.B \-u
175-
Force the binary I/O layers of stdin, stdout and stderr to be unbuffered.
175+
Force the binary I/O layers of stdout and stderr to be unbuffered.
176+
stdin is always buffered.
176177
The text I/O layer will still be line-buffered.
177178
.\" Note that there is internal buffering in readlines() and
178179
.\" file-object iterators ("for line in sys.stdin") which is not

Modules/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ static char *usage_2 = "\
7777
-S : don't imply 'import site' on initialization\n\
7878
";
7979
static char *usage_3 = "\
80-
-u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x\n\
80+
-u : unbuffered binary stdout and stderr, stdin always buffered;\n\
81+
also PYTHONUNBUFFERED=x\n\
8182
see man page for details on internal buffering relating to '-u'\n\
8283
-v : verbose (trace import statements); also PYTHONVERBOSE=x\n\
8384
can be supplied multiple times to increase verbosity\n\

0 commit comments

Comments
 (0)