]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#5107: document that default encoding is the same as locale.getpreferredencoding().
authorGeorg Brandl <georg@python.org>
Thu, 5 Feb 2009 10:47:16 +0000 (10:47 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 5 Feb 2009 10:47:16 +0000 (10:47 +0000)
Doc/library/functions.rst

index 744a99f8548b0c875118fa2ac655af98439f219a..b5a4fb8bbe13a8bcd2e7f2b3cdb843d82f893cc3 100644 (file)
@@ -666,9 +666,14 @@ are always available.  They are listed here in alphabetical order.
    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