Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 296d1be

Browse files
committed
Restore original line lengths.
1 parent 6f5c5cb commit 296d1be

2 files changed

Lines changed: 26 additions & 32 deletions

File tree

Doc/library/functions.rst

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -878,22 +878,19 @@ are always available. They are listed here in alphabetical order.
878878
mode). It can be ``None``, ``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It
879879
works as follows:
880880

881-
* When reading input from the stream, if *newline* is ``None``,
882-
universal newlines mode is enabled. Lines in the input can end
883-
in ``'\n'``, ``'\r'``, or ``'\r\n'``, and these are translated
884-
into ``'\n'`` before being returned to the caller. If it is
885-
``''``, universal newline mode is enabled, but line endings are
886-
returned to the caller untranslated. If it has any of the other
887-
legal values, input lines are only terminated by the given
888-
string, and the line ending is returned to the caller
889-
untranslated.
890-
891-
* When writing output to the stream, if *newline* is ``None``, any
892-
``'\n'`` characters written are translated to the system default
893-
line separator, :data:`os.linesep`. If *newline* is ``''`` or
894-
``'\n'``, no translation takes place. If *newline* is any of the
895-
other legal values, any ``'\n'`` characters written are
896-
translated to the given string.
881+
* When reading input from the stream, if *newline* is ``None``, universal
882+
newlines mode is enabled. Lines in the input can end in ``'\n'``,
883+
``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'`` before
884+
being returned to the caller. If it is ``''``, universal newline mode is
885+
enabled, but line endings are returned to the caller untranslated. If it
886+
has any of the other legal values, input lines are only terminated by the
887+
given string, and the line ending is returned to the caller untranslated.
888+
889+
* When writing output to the stream, if *newline* is ``None``, any ``'\n'``
890+
characters written are translated to the system default line separator,
891+
:data:`os.linesep`. If *newline* is ``''`` or ``'\n'``, no translation
892+
takes place. If *newline* is any of the other legal values, any ``'\n'``
893+
characters written are translated to the given string.
897894

898895
If *closefd* is ``False`` and a file descriptor rather than a filename was
899896
given, the underlying file descriptor will be kept open when the file is

Doc/library/io.rst

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -760,22 +760,19 @@ Text I/O
760760
*newline* controls how line endings are handled. It can be ``None``,
761761
``''``, ``'\n'``, ``'\r'``, and ``'\r\n'``. It works as follows:
762762

763-
* When reading input from the stream, if *newline* is ``None``,
764-
universal newlines mode is enabled. Lines in the input can end
765-
in ``'\n'``, ``'\r'``, or ``'\r\n'``, and these are translated
766-
into ``'\n'`` before being returned to the caller. If it is
767-
``''``, universal newline mode is enabled, but line endings are
768-
returned to the caller untranslated. If it has any of the other
769-
legal values, input lines are only terminated by the given
770-
string, and the line ending is returned to the caller
771-
untranslated.
772-
773-
* When writing output to the stream, if *newline* is ``None``, any
774-
``'\n'`` characters written are translated to the system default
775-
line separator, :data:`os.linesep`. If *newline* is ``''`` or
776-
``'\n'``, no translation takes place. If *newline* is any of the
777-
other legal values, any ``'\n'`` characters written are
778-
translated to the given string.
763+
* When reading input from the stream, if *newline* is ``None``, universal
764+
newlines mode is enabled. Lines in the input can end in ``'\n'``,
765+
``'\r'``, or ``'\r\n'``, and these are translated into ``'\n'`` before
766+
being returned to the caller. If it is ``''``, universal newline mode is
767+
enabled, but line endings are returned to the caller untranslated. If it
768+
has any of the other legal values, input lines are only terminated by the
769+
given string, and the line ending is returned to the caller untranslated.
770+
771+
* When writing output to the stream, if *newline* is ``None``, any ``'\n'``
772+
characters written are translated to the system default line separator,
773+
:data:`os.linesep`. If *newline* is ``''`` or ``'\n'``, no translation
774+
takes place. If *newline* is any of the other legal values, any ``'\n'``
775+
characters written are translated to the given string.
779776

780777
If *line_buffering* is ``True``, :meth:`flush` is implied when a call to
781778
write contains a newline character.

0 commit comments

Comments
 (0)