mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Restore original line lengths.
This commit is contained in:
parent
6f5c5cb75b
commit
296d1bea6a
2 changed files with 24 additions and 30 deletions
|
|
@ -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
|
mode). It can be ``None``, ``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It
|
||||||
works as follows:
|
works as follows:
|
||||||
|
|
||||||
* When reading input from the stream, if *newline* is ``None``,
|
* When reading input from the stream, if *newline* is ``None``, universal
|
||||||
universal newlines mode is enabled. Lines in the input can end
|
newlines mode is enabled. Lines in the input can end in ``'\n'``,
|
||||||
in ``'\n'``, ``'\r'``, or ``'\r\n'``, and these are translated
|
``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'`` before
|
||||||
into ``'\n'`` before being returned to the caller. If it is
|
being returned to the caller. If it is ``''``, universal newline mode is
|
||||||
``''``, universal newline mode is enabled, but line endings are
|
enabled, but line endings are returned to the caller untranslated. If it
|
||||||
returned to the caller untranslated. If it has any of the other
|
has any of the other legal values, input lines are only terminated by the
|
||||||
legal values, input lines are only terminated by the given
|
given string, and the line ending is returned to the caller untranslated.
|
||||||
string, and the line ending is returned to the caller
|
|
||||||
untranslated.
|
|
||||||
|
|
||||||
* When writing output to the stream, if *newline* is ``None``, any
|
* When writing output to the stream, if *newline* is ``None``, any ``'\n'``
|
||||||
``'\n'`` characters written are translated to the system default
|
characters written are translated to the system default line separator,
|
||||||
line separator, :data:`os.linesep`. If *newline* is ``''`` or
|
:data:`os.linesep`. If *newline* is ``''`` or ``'\n'``, no translation
|
||||||
``'\n'``, no translation takes place. If *newline* is any of the
|
takes place. If *newline* is any of the other legal values, any ``'\n'``
|
||||||
other legal values, any ``'\n'`` characters written are
|
characters written are translated to 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
|
||||||
|
|
|
||||||
|
|
@ -760,22 +760,19 @@ Text I/O
|
||||||
*newline* controls how line endings are handled. It can be ``None``,
|
*newline* controls how line endings are handled. It can be ``None``,
|
||||||
``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It works as follows:
|
``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It works as follows:
|
||||||
|
|
||||||
* When reading input from the stream, if *newline* is ``None``,
|
* When reading input from the stream, if *newline* is ``None``, universal
|
||||||
universal newlines mode is enabled. Lines in the input can end
|
newlines mode is enabled. Lines in the input can end in ``'\n'``,
|
||||||
in ``'\n'``, ``'\r'``, or ``'\r\n'``, and these are translated
|
``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'`` before
|
||||||
into ``'\n'`` before being returned to the caller. If it is
|
being returned to the caller. If it is ``''``, universal newline mode is
|
||||||
``''``, universal newline mode is enabled, but line endings are
|
enabled, but line endings are returned to the caller untranslated. If it
|
||||||
returned to the caller untranslated. If it has any of the other
|
has any of the other legal values, input lines are only terminated by the
|
||||||
legal values, input lines are only terminated by the given
|
given string, and the line ending is returned to the caller untranslated.
|
||||||
string, and the line ending is returned to the caller
|
|
||||||
untranslated.
|
|
||||||
|
|
||||||
* When writing output to the stream, if *newline* is ``None``, any
|
* When writing output to the stream, if *newline* is ``None``, any ``'\n'``
|
||||||
``'\n'`` characters written are translated to the system default
|
characters written are translated to the system default line separator,
|
||||||
line separator, :data:`os.linesep`. If *newline* is ``''`` or
|
:data:`os.linesep`. If *newline* is ``''`` or ``'\n'``, no translation
|
||||||
``'\n'``, no translation takes place. If *newline* is any of the
|
takes place. If *newline* is any of the other legal values, any ``'\n'``
|
||||||
other legal values, any ``'\n'`` characters written are
|
characters written are translated to 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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue