[Python-checkins] r69291 - python/branches/py3k/Doc/library/functions.rst

georg.brandl python-checkins at python.org
Thu Feb 5 11:47:16 CET 2009


Author: georg.brandl
Date: Thu Feb  5 11:47:16 2009
New Revision: 69291

Log:
#5107: document that default encoding is the same as locale.getpreferredencoding().

Modified:
   python/branches/py3k/Doc/library/functions.rst

Modified: python/branches/py3k/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k/Doc/library/functions.rst	(original)
+++ python/branches/py3k/Doc/library/functions.rst	Thu Feb  5 11:47:16 2009
@@ -666,9 +666,14 @@
    Other common values are ``'w'`` for 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).  In text mode, if *encoding* is not specified the
-   encoding used is platform dependent. (For reading and writing raw bytes use
-   binary mode and leave *encoding* unspecified.)  The available modes are:
+   current seek position).
+
+   In text mode, if *encoding* is not specified the encoding used is the same as
+   returned by :func:`locale.getpreferredencoding`, if the :mod:`locale` module
+   is available, else ASCII.  For reading and writing raw bytes, use binary mode
+   and leave *encoding* unspecified.
+
+   The available modes are:
 
    ========= ===============================================================
    Character Meaning


More information about the Python-checkins mailing list