[Python-checkins] cpython (3.2): Clarify universal-newline wording in tutorial (issue #16266).

chris.jerdonek python-checkins at python.org
Thu Oct 18 05:31:11 CEST 2012


http://hg.python.org/cpython/rev/7b2a13b20b33
changeset:   79809:7b2a13b20b33
branch:      3.2
parent:      79798:16493102f9b1
user:        Chris Jerdonek <chris.jerdonek at gmail.com>
date:        Wed Oct 17 20:17:41 2012 -0700
summary:
  Clarify universal-newline wording in tutorial (issue #16266).

files:
  Doc/tutorial/inputoutput.rst |  7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -256,9 +256,10 @@
 :dfn:`binary mode`: now the data is read and written in the form of bytes
 objects.  This mode should be used for all files that don't contain text.
 
-In text mode, the default is to convert platform-specific line endings (``\n``
-on Unix, ``\r\n`` on Windows) to just ``\n`` on reading and ``\n`` back to
-platform-specific line endings on writing.  This behind-the-scenes modification
+In text mode, the default when reading is to convert platform-specific line
+endings (``\n`` on Unix, ``\r\n`` on Windows) to just ``\n``.  When writing in
+text mode, the default is to convert occurrences of ``\n`` back to
+platform-specific line endings.  This behind-the-scenes modification
 to file data is fine for text files, but will corrupt binary data like that in
 :file:`JPEG` or :file:`EXE` files.  Be very careful to use binary mode when
 reading and writing such files.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list