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

Skip to content

Commit 7f58097

Browse files
authored
bpo-28647: Update -u documentation after bpo-30404 (GH-3961)
1 parent b22273e commit 7f58097

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

Doc/library/sys.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,9 +1275,9 @@ always available.
12751275
Under all platforms though, you can override this value by setting the
12761276
:envvar:`PYTHONIOENCODING` environment variable before starting Python.
12771277

1278-
* When interactive, standard streams are line-buffered. Otherwise, they
1279-
are block-buffered like regular text files. You can override this
1280-
value with the :option:`-u` command-line option.
1278+
* When interactive, ``stdout`` and ``stderr`` streams are line-buffered.
1279+
Otherwise, they are block-buffered like regular text files. You can
1280+
override this value with the :option:`-u` command-line option.
12811281

12821282
.. note::
12831283

Doc/using/cmdline.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ Miscellaneous options
303303

304304
.. cmdoption:: -u
305305

306-
Force the stdout and stderr streams to be unbuffered.
306+
Force the stdout and stderr streams to be unbuffered. This option has no
307+
effect on the stdin stream.
307308

308309
See also :envvar:`PYTHONUNBUFFERED`.
309310

Misc/python.man

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,8 @@ that it entails. Also disable these manipulations if
178178
is explicitly imported later.
179179
.TP
180180
.B \-u
181-
Force the binary I/O layers of stdout and stderr to be unbuffered.
182-
stdin is always buffered.
183-
The text I/O layer will still be line-buffered.
184-
.\" Note that there is internal buffering in readlines() and
185-
.\" file-object iterators ("for line in sys.stdin") which is not
186-
.\" influenced by this option. To work around this, you will want to use
187-
.\" "sys.stdin.readline()" inside a "while 1:" loop.
181+
Force the stdout and stderr streams to be unbuffered.
182+
This option has no effect on the stdin stream.
188183
.TP
189184
.B \-v
190185
Print a message each time a module is initialized, showing the place

Modules/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ static const char usage_2[] = "\
7171
-S : don't imply 'import site' on initialization\n\
7272
";
7373
static const char usage_3[] = "\
74-
-u : unbuffered binary stdout and stderr, stdin always buffered;\n\
75-
also PYTHONUNBUFFERED=x\n\
76-
see man page for details on internal buffering relating to '-u'\n\
74+
-u : force the stdout and stderr streams to be unbuffered;\n\
75+
this option has no effect on stdin; also PYTHONUNBUFFERED=x\n\
7776
-v : verbose (trace import statements); also PYTHONVERBOSE=x\n\
7877
can be supplied multiple times to increase verbosity\n\
7978
-V : print the Python version number and exit (also --version)\n\

0 commit comments

Comments
 (0)