]> granicus.if.org Git - python/commitdiff
bpo-28647: Update -u documentation after bpo-30404 (GH-3961)
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 13 Oct 2017 12:16:31 +0000 (15:16 +0300)
committerGitHub <noreply@github.com>
Fri, 13 Oct 2017 12:16:31 +0000 (15:16 +0300)
Doc/library/sys.rst
Doc/using/cmdline.rst
Misc/python.man
Modules/main.c

index aa7bd477b05a1b833c1bf24921363f0ea1db6cca..853e91b93de5d5d3fc255febab2b87a0ae176459 100644 (file)
@@ -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::
 
index a8cdff641e4545b21bc5b5ab8f4a79461c7d97de..8ab26f595578fd19a5b549d3f5e7bdb6aa3125c2 100644 (file)
@@ -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`.
 
index 075b974e90495558f9a1763038755661feb343bc..9f71d69dfaf260ea8eedff6c443ba755b91a276c 100644 (file)
@@ -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
index 3e347dc8e243c6e86609f743c6ac09b6254ab3fc..e86211331047ee68898d2a2cbe38346aa58737ec 100644 (file)
@@ -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\