diff options
author | Georg Brandl <georg@python.org> | 2012-08-14 07:39:07 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-08-14 07:39:07 (GMT) |
commit | 296d1bea6aab9c5cb78ec4f90369352aba64d7c5 (patch) | |
tree | fe900227784c11adc53d0f6a3c509d55aadeb5d9 /Doc/library | |
parent | 6f5c5cb75b2fddf31cbb311d2a5508c54f6e21f6 (diff) | |
download | cpython-296d1bea6aab9c5cb78ec4f90369352aba64d7c5.zip cpython-296d1bea6aab9c5cb78ec4f90369352aba64d7c5.tar.gz cpython-296d1bea6aab9c5cb78ec4f90369352aba64d7c5.tar.bz2 |
Restore original line lengths.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/functions.rst | 29 | ||||
-rw-r--r-- | Doc/library/io.rst | 29 |
2 files changed, 26 insertions, 32 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index ffc34d8..3b94495 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -878,22 +878,19 @@ are always available. They are listed here in alphabetical order. 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 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. - - * When writing output to the stream, if *newline* is ``None``, any - ``'\n'`` characters written are translated to the system default - line separator, :data:`os.linesep`. If *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. + * 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 + 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. + + * When writing output to the stream, if *newline* is ``None``, any ``'\n'`` + characters written are translated to the system default line separator, + :data:`os.linesep`. If *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 09e0501..b302c64 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -760,22 +760,19 @@ Text I/O *newline* controls how line endings are handled. 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 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. - - * When writing output to the stream, if *newline* is ``None``, any - ``'\n'`` characters written are translated to the system default - line separator, :data:`os.linesep`. If *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. + * 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 + 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. + + * When writing output to the stream, if *newline* is ``None``, any ``'\n'`` + characters written are translated to the system default line separator, + :data:`os.linesep`. If *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. |