summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-08-03 23:22:07 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-08-03 23:22:07 (GMT)
commitd1f9352bd4b30ccfe665109b1341433a00dc6256 (patch)
treeb8aa8be72c756344cf35ce37ff0b90c2ea12b4cb
parent3c25dfbf13279c90cf35e5b4424f1c94483306d3 (diff)
parent401e17d0f06dd6594835424c5544689abdc0cc9f (diff)
downloadcpython-d1f9352bd4b30ccfe665109b1341433a00dc6256.zip
cpython-d1f9352bd4b30ccfe665109b1341433a00dc6256.tar.gz
cpython-d1f9352bd4b30ccfe665109b1341433a00dc6256.tar.bz2
(Merge 3.2) open() / TextIOWrapper doc: make it explicit than newline='\n'
doesn't translate newlines on output.
-rw-r--r--Doc/library/functions.rst6
-rw-r--r--Doc/library/io.rst6
-rw-r--r--Modules/_io/_iomodule.c6
-rw-r--r--Modules/_io/textio.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 0bb22aa..3f56621 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -887,9 +887,9 @@ are always available. They are listed here in alphabetical order.
* 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
index 0aadc9d..aeaf56b 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -780,9 +780,9 @@ Text I/O
* 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
index 61b9f52..15781ac 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -185,9 +185,9 @@ PyDoc_STRVAR(open_doc,
"\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
index dbb551e..421dc50 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -648,9 +648,9 @@ PyDoc_STRVAR(textiowrapper_doc,
"\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."