Commit c61a8549 authored by Victor Stinner's avatar Victor Stinner

open() / TextIOWrapper doc: make it explicit than newline='\n' doesn't

translate newlines on output.
parent 67081c31
...@@ -888,9 +888,9 @@ are always available. They are listed here in alphabetical order. ...@@ -888,9 +888,9 @@ are always available. They are listed here in alphabetical order.
* On output, if *newline* is ``None``, any ``'\n'`` characters written are * On output, if *newline* is ``None``, any ``'\n'`` characters written are
translated to the system default line separator, :data:`os.linesep`. If translated to the system default line separator, :data:`os.linesep`. If
*newline* is ``''``, no translation takes place. If *newline* is any of *newline* is ``''`` or ``'\n'``, no translation takes place. If *newline*
the other legal values, any ``'\n'`` characters written are translated to is any of the other legal values, any ``'\n'`` characters written are
the given string. translated to the given string.
If *closefd* is ``False`` and a file descriptor rather than a filename was 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 given, the underlying file descriptor will be kept open when the file is
......
...@@ -770,9 +770,9 @@ Text I/O ...@@ -770,9 +770,9 @@ Text I/O
* On output, if *newline* is ``None``, any ``'\n'`` characters written are * On output, if *newline* is ``None``, any ``'\n'`` characters written are
translated to the system default line separator, :data:`os.linesep`. If translated to the system default line separator, :data:`os.linesep`. If
*newline* is ``''``, no translation takes place. If *newline* is any of *newline* is ``''`` or ``'\n'``, no translation takes place. If *newline*
the other legal values, any ``'\n'`` characters written are translated to is any of the other legal values, any ``'\n'`` characters written are
the given string. translated to the given string.
If *line_buffering* is ``True``, :meth:`flush` is implied when a call to If *line_buffering* is ``True``, :meth:`flush` is implied when a call to
write contains a newline character. write contains a newline character.
......
...@@ -264,9 +264,9 @@ PyDoc_STRVAR(open_doc, ...@@ -264,9 +264,9 @@ PyDoc_STRVAR(open_doc,
"\n" "\n"
"* On output, if newline is None, any '\\n' characters written are\n" "* On output, if newline is None, any '\\n' characters written are\n"
" translated to the system default line separator, os.linesep. If\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" " newline is '' or '\n', no translation takes place. If newline is any\n"
" other legal values, any '\\n' characters written are translated to\n" " of the other legal values, any '\\n' characters written are translated\n"
" the given string.\n" " to the given string.\n"
"\n" "\n"
"If closefd is False, the underlying file descriptor will be kept open\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" "when the file is closed. This does not work when a file name is given\n"
......
...@@ -635,9 +635,9 @@ PyDoc_STRVAR(textiowrapper_doc, ...@@ -635,9 +635,9 @@ PyDoc_STRVAR(textiowrapper_doc,
"\n" "\n"
"* On output, if newline is None, any '\\n' characters written are\n" "* On output, if newline is None, any '\\n' characters written are\n"
" translated to the system default line separator, os.linesep. If\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" " newline is '' or '\n', no translation takes place. If newline is any\n"
" other legal values, any '\\n' characters written are translated to\n" " of the other legal values, any '\\n' characters written are translated\n"
" the given string.\n" " to the given string.\n"
"\n" "\n"
"If line_buffering is True, a call to flush is implied when a call to\n" "If line_buffering is True, a call to flush is implied when a call to\n"
"write contains a newline character." "write contains a newline character."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment