diff options
author | Georg Brandl <georg@python.org> | 2008-01-13 09:36:18 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-13 09:36:18 (GMT) |
commit | 9f1e2ecb48b8ffd4e72c5cc183e71147cb22e122 (patch) | |
tree | e8032d2d225369e1a253b0c23d161aa86e684aa0 /Doc | |
parent | 8bdd044dfd13621130b03e276cf1da770ccf8a1d (diff) | |
download | cpython-9f1e2ecb48b8ffd4e72c5cc183e71147cb22e122.zip cpython-9f1e2ecb48b8ffd4e72c5cc183e71147cb22e122.tar.gz cpython-9f1e2ecb48b8ffd4e72c5cc183e71147cb22e122.tar.bz2 |
Clarify the effect of text mode.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functions.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 622ff5f4..665b865 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -734,7 +734,9 @@ available. They are listed here in alphabetical order. 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 |