[Python-checkins] r59937 - python/trunk/Doc/library/functions.rst
georg.brandl
python-checkins at python.org
Sun Jan 13 10:36:18 CET 2008
Author: georg.brandl
Date: Sun Jan 13 10:36:18 2008
New Revision: 59937
Modified:
python/trunk/Doc/library/functions.rst
Log:
Clarify the effect of text mode.
Modified: python/trunk/Doc/library/functions.rst
==============================================================================
--- python/trunk/Doc/library/functions.rst (original)
+++ python/trunk/Doc/library/functions.rst Sun Jan 13 10:36:18 2008
@@ -734,7 +734,9 @@
writing (truncating the file if it already exists), and ``'a'`` for appending
(which on *some* Unix systems means that *all* writes append to the end of the
file regardless of the current seek position). If *mode* is omitted, it
- defaults to ``'r'``. When opening a binary file, you should append ``'b'`` to
+ defaults to ``'r'``. The default is to use text mode, which may convert
+ ``'\n'`` characters to a platform-specific representation on writing and back
+ on reading. Thus, when opening a binary file, you should append ``'b'`` to
the *mode* value to open the file in binary mode, which will improve
portability. (Appending ``'b'`` is useful even on systems that don't treat
binary and text files differently, where it serves as documentation.) See below
More information about the Python-checkins
mailing list