summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-08-15 15:11:27 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-08-15 15:11:27 (GMT)
commit27bbcfb8ff55ed2c57042bf72eb2ba01ec7e4169 (patch)
treed4a7886a29e92e4811c1087086aa30e1c27eb586 /Doc/library/functions.rst
parent592df20efcc41d2448c8acc35b3b4f15aa5c0bf2 (diff)
parentee0a945ae4077d9e4ffdb77e247ed13265316897 (diff)
downloadcpython-27bbcfb8ff55ed2c57042bf72eb2ba01ec7e4169.zip
cpython-27bbcfb8ff55ed2c57042bf72eb2ba01ec7e4169.tar.gz
cpython-27bbcfb8ff55ed2c57042bf72eb2ba01ec7e4169.tar.bz2
Merge #15543: glossary entry for and 'universal newlines', and links to it.
Patch by Chris Jerdonek.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 86e565f..de29a1a 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -819,7 +819,7 @@ are always available. They are listed here in alphabetical order.
``'b'`` binary mode
``'t'`` text mode (default)
``'+'`` open a disk file for updating (reading and writing)
- ``'U'`` universal newline mode (for backwards compatibility; should
+ ``'U'`` universal newlines mode (for backwards compatibility; should
not be used in new code)
========= ===============================================================
@@ -874,14 +874,17 @@ are always available. They are listed here in alphabetical order.
used. Any other error handling name that has been registered with
:func:`codecs.register_error` is also valid.
- *newline* controls how universal newlines works (it only applies to text
- mode). It can be ``None``, ``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It
- works as follows:
+ .. index::
+ single: universal newlines; open() built-in function
+
+ *newline* controls how :term:`universal newlines` mode works (it only
+ applies to text mode). It can be ``None``, ``''``, ``'\n'``, ``'\r'``, and
+ ``'\r\n'``. It works as follows:
* When reading input from the stream, if *newline* is ``None``, universal
newlines mode is enabled. Lines in the input can end in ``'\n'``,
``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'`` before
- being returned to the caller. If it is ``''``, universal newline mode is
+ being returned to the caller. If it is ``''``, universal newlines mode is
enabled, but line endings are returned to the caller untranslated. If it
has any of the other legal values, input lines are only terminated by the
given string, and the line ending is returned to the caller untranslated.