[Python-checkins] cpython (merge 3.2 -> default): Issue #13597: Fix the documentation of the "-u" command-line option, and
antoine.pitrou
python-checkins at python.org
Wed Dec 21 11:25:31 CET 2011
http://hg.python.org/cpython/rev/1ab124a6f171
changeset: 74109:1ab124a6f171
parent: 74107:b07b1e58582d
parent: 74108:19df72a77b39
user: Antoine Pitrou <solipsis at pitrou.net>
date: Wed Dec 21 11:24:47 2011 +0100
summary:
Issue #13597: Fix the documentation of the "-u" command-line option, and wording of "What's new in Python 3.0" about standard streams.
files:
Doc/using/cmdline.rst | 3 ++-
Doc/whatsnew/3.0.rst | 10 +++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -249,7 +249,8 @@
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
- layer will still be line-buffered.
+ layer will still be line-buffered if writing to the console, or
+ block-buffered if redirected to a non-interactive file.
See also :envvar:`PYTHONUNBUFFERED`.
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst
--- a/Doc/whatsnew/3.0.rst
+++ b/Doc/whatsnew/3.0.rst
@@ -301,6 +301,12 @@
There is no longer any need for using the encoding-aware streams
in the :mod:`codecs` module.
+* The initial values of :data:`sys.stdin`, :data:`sys.stdout` and
+ :data:`sys.stderr` are now unicode-only text files (i.e., they are
+ instances of :class:`io.TextIOBase`). To read and write bytes data
+ with these streams, you need to use their :data:`io.TextIOBase.buffer`
+ attribute.
+
* Filenames are passed to and returned from APIs as (Unicode) strings.
This can present platform-specific problems because on some
platforms filenames are arbitrary byte strings. (On the other hand,
@@ -511,9 +517,7 @@
produces a literal of type :class:`bytes`.
* :ref:`pep-3116`. The :mod:`io` module is now the standard way of
- doing file I/O, and the initial values of :data:`sys.stdin`,
- :data:`sys.stdout` and :data:`sys.stderr` are now instances of
- :class:`io.TextIOBase`. The built-in :func:`open` function is now an
+ doing file I/O. The built-in :func:`open` function is now an
alias for :func:`io.open` and has additional keyword arguments
*encoding*, *errors*, *newline* and *closefd*. Also note that an
invalid *mode* argument now raises :exc:`ValueError`, not
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list