diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-10-13 12:16:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-13 12:16:31 (GMT) |
commit | 7f580970836b0f6bc9c5db868d95bea81a3e1558 (patch) | |
tree | f4e4eb4079870015865188ee3669a1d1905fb80d | |
parent | b22273ec5d1992b0cbe078b887427ae9977dfb78 (diff) | |
download | cpython-7f580970836b0f6bc9c5db868d95bea81a3e1558.zip cpython-7f580970836b0f6bc9c5db868d95bea81a3e1558.tar.gz cpython-7f580970836b0f6bc9c5db868d95bea81a3e1558.tar.bz2 |
bpo-28647: Update -u documentation after bpo-30404 (GH-3961)
-rw-r--r-- | Doc/library/sys.rst | 6 | ||||
-rw-r--r-- | Doc/using/cmdline.rst | 3 | ||||
-rw-r--r-- | Misc/python.man | 9 | ||||
-rw-r--r-- | Modules/main.c | 5 |
4 files changed, 9 insertions, 14 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index aa7bd47..853e91b 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1275,9 +1275,9 @@ always available. Under all platforms though, you can override this value by setting the :envvar:`PYTHONIOENCODING` environment variable before starting Python. - * When interactive, standard streams are line-buffered. Otherwise, they - are block-buffered like regular text files. You can override this - value with the :option:`-u` command-line option. + * When interactive, ``stdout`` and ``stderr`` streams are line-buffered. + Otherwise, they are block-buffered like regular text files. You can + override this value with the :option:`-u` command-line option. .. note:: diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index a8cdff6..8ab26f5 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -303,7 +303,8 @@ Miscellaneous options .. cmdoption:: -u - Force the stdout and stderr streams to be unbuffered. + Force the stdout and stderr streams to be unbuffered. This option has no + effect on the stdin stream. See also :envvar:`PYTHONUNBUFFERED`. diff --git a/Misc/python.man b/Misc/python.man index 075b974..9f71d69 100644 --- a/Misc/python.man +++ b/Misc/python.man @@ -178,13 +178,8 @@ that it entails. Also disable these manipulations if is explicitly imported later. .TP .B \-u -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 -.\" influenced by this option. To work around this, you will want to use -.\" "sys.stdin.readline()" inside a "while 1:" loop. +Force the stdout and stderr streams to be unbuffered. +This option has no effect on the stdin stream. .TP .B \-v Print a message each time a module is initialized, showing the place diff --git a/Modules/main.c b/Modules/main.c index 3e347dc..e862113 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -71,9 +71,8 @@ static const char usage_2[] = "\ -S : don't imply 'import site' on initialization\n\ "; static const char usage_3[] = "\ --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\ +-u : force the stdout and stderr streams to be unbuffered;\n\ + this option has no effect on stdin; also PYTHONUNBUFFERED=x\n\ -v : verbose (trace import statements); also PYTHONVERBOSE=x\n\ can be supplied multiple times to increase verbosity\n\ -V : print the Python version number and exit (also --version)\n\ |