[Python-checkins] cpython (merge 3.2 -> default): (Merge 3.2) open() / TextIOWrapper doc: make it explicit than newline='\n'

victor.stinner python-checkins at python.org
Sat Aug 4 01:27:30 CEST 2012


http://hg.python.org/cpython/rev/083776adcacc
changeset:   78404:083776adcacc
parent:      78401:f17a1410ebe5
parent:      78403:243ad1a6f638
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Aug 04 01:22:07 2012 +0200
summary:
  (Merge 3.2) open() / TextIOWrapper doc: make it explicit than newline='\n'
doesn't translate newlines on output.

files:
  Doc/library/functions.rst |  6 +++---
  Doc/library/io.rst        |  6 +++---
  Modules/_io/_iomodule.c   |  6 +++---
  Modules/_io/textio.c      |  6 +++---
  4 files changed, 12 insertions(+), 12 deletions(-)


diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -887,9 +887,9 @@
 
    * On output, if *newline* is ``None``, any ``'\n'`` characters written are
      translated to the system default line separator, :data:`os.linesep`.  If
-     *newline* is ``''``, no translation takes place.  If *newline* is any of
-     the other legal values, any ``'\n'`` characters written are translated to
-     the given string.
+     *newline* is ``''`` or ``'\n'``, no translation takes place.  If *newline*
+     is any of the other legal values, any ``'\n'`` characters written are
+     translated to the given string.
 
    If *closefd* is ``False`` and a file descriptor rather than a filename was
    given, the underlying file descriptor will be kept open when the file is
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -780,9 +780,9 @@
 
    * On output, if *newline* is ``None``, any ``'\n'`` characters written are
      translated to the system default line separator, :data:`os.linesep`.  If
-     *newline* is ``''``, no translation takes place.  If *newline* is any of
-     the other legal values, any ``'\n'`` characters written are translated to
-     the given string.
+     *newline* is ``''`` or ``'\n'``, no translation takes place.  If *newline*
+     is any of the other legal values, any ``'\n'`` characters written are
+     translated to the given string.
 
    If *line_buffering* is ``True``, :meth:`flush` is implied when a call to
    write contains a newline character.
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -185,9 +185,9 @@
 "\n"
 "* On output, if newline is None, any '\\n' characters written are\n"
 "  translated to the system default line separator, os.linesep. If\n"
-"  newline is '', no translation takes place. If newline is any of the\n"
-"  other legal values, any '\\n' characters written are translated to\n"
-"  the given string.\n"
+"  newline is '' or '\n', no translation takes place. If newline is any\n"
+"  of the other legal values, any '\\n' characters written are translated\n"
+"  to the given string.\n"
 "\n"
 "If closefd is False, the underlying file descriptor will be kept open\n"
 "when the file is closed. This does not work when a file name is given\n"
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -648,9 +648,9 @@
     "\n"
     "* On output, if newline is None, any '\\n' characters written are\n"
     "  translated to the system default line separator, os.linesep. If\n"
-    "  newline is '', no translation takes place. If newline is any of the\n"
-    "  other legal values, any '\\n' characters written are translated to\n"
-    "  the given string.\n"
+    "  newline is '' or '\n', no translation takes place. If newline is any\n"
+    "  of the other legal values, any '\\n' characters written are translated\n"
+    "  to the given string.\n"
     "\n"
     "If line_buffering is True, a call to flush is implied when a call to\n"
     "write contains a newline character."

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list