diff options
author | Georg Brandl <georg@python.org> | 2009-02-05 10:47:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-02-05 10:47:16 (GMT) |
commit | f3048e5b9600e24f2c16eeef48695f3e706133c7 (patch) | |
tree | 76b78f98294ea48c008195ec4ca8eb7ae33f90e4 | |
parent | 2ae8ac2bfec3061b7b6ce2d6ebef1e5bdcbb0e3a (diff) | |
download | cpython-f3048e5b9600e24f2c16eeef48695f3e706133c7.zip cpython-f3048e5b9600e24f2c16eeef48695f3e706133c7.tar.gz cpython-f3048e5b9600e24f2c16eeef48695f3e706133c7.tar.bz2 |
#5107: document that default encoding is the same as locale.getpreferredencoding().
-rw-r--r-- | Doc/library/functions.rst | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 744a99f..b5a4fb8 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -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 |