From: Ezio Melotti Date: Thu, 25 Jul 2013 03:04:02 +0000 (+0200) Subject: #16937: document that stdin is always buffered, even when -u is used. Patch by Elena... X-Git-Tag: v3.4.0a1~90^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61b0c672b5e9ba1cf564947ecb38d175fd70ea7e;p=python #16937: document that stdin is always buffered, even when -u is used. Patch by Elena Oat. --- diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index e0c80f6bcb..f2d261675a 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -269,8 +269,8 @@ Miscellaneous options .. cmdoption:: -u - Force the binary layer of the stdin, stdout and stderr streams (which is - available as their ``buffer`` attribute) to be unbuffered. The text I/O + Force the binary layer of the stdout and stderr streams (which is + available as their ``buffer`` attribute) to be unbuffered. The text I/O layer will still be line-buffered if writing to the console, or block-buffered if redirected to a non-interactive file. diff --git a/Misc/ACKS b/Misc/ACKS index c85b437818..288f18613b 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -896,6 +896,7 @@ Tim O'Malley Zooko O'Whielacronx Aaron Oakley James Oakley +Elena Oat Jon Oberheide Pascal Oberndoerfer Jeffrey Ollie diff --git a/Misc/python.man b/Misc/python.man index 8155e6a447..bcb3ec8723 100644 --- a/Misc/python.man +++ b/Misc/python.man @@ -172,7 +172,8 @@ that it entails. Also disable these manipulations if is explicitly imported later. .TP .B \-u -Force the binary I/O layers of stdin, stdout and stderr to be unbuffered. +Force the binary I/O layers of stdout and stderr to be unbuffered. +stdin is always buffered. The text I/O layer will still be line-buffered. .\" Note that there is internal buffering in readlines() and .\" file-object iterators ("for line in sys.stdin") which is not diff --git a/Modules/main.c b/Modules/main.c index 4d2e03ad9e..3cfc9c3bd4 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -77,7 +77,8 @@ static char *usage_2 = "\ -S : don't imply 'import site' on initialization\n\ "; static char *usage_3 = "\ --u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x\n\ +-u : unbuffered binary stdout and stderr, stdin always buffered;\n\ + also PYTHONUNBUFFERED=x\n\ see man page for details on internal buffering relating to '-u'\n\ -v : verbose (trace import statements); also PYTHONVERBOSE=x\n\ can be supplied multiple times to increase verbosity\n\