summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-06-05 11:43:22 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-06-05 11:43:22 (GMT)
commitf86a5e8a93ab293d4cc00a8f2835d6d2cd3baa69 (patch)
tree9d249e4c06f25885dc668edd529b1a4c802c898a /Modules/_io/_iomodule.c
parent91c5a34613fb918c79bb372723e10e106ad9a9be (diff)
downloadcpython-f86a5e8a93ab293d4cc00a8f2835d6d2cd3baa69.zip
cpython-f86a5e8a93ab293d4cc00a8f2835d6d2cd3baa69.tar.gz
cpython-f86a5e8a93ab293d4cc00a8f2835d6d2cd3baa69.tar.bz2
Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
open() and io.TextIOWrapper are now calling locale.getpreferredencoding(False) instead of locale.getpreferredencoding() in text mode if the encoding is not specified. Don't change temporary the locale encoding using locale.setlocale(), use the current locale encoding instead of the user preferred encoding. Explain also in open() documentation that locale.getpreferredencoding(False) is called if the encoding is not specified.
Diffstat (limited to 'Modules/_io/_iomodule.c')
-rw-r--r--Modules/_io/_iomodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 31eea3c..61b9f52 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -112,8 +112,9 @@ PyDoc_STRVAR(open_doc,
"'a' for appending (which on some Unix systems, means that all writes\n"
"append to the end of the file regardless of the current seek position).\n"
"In text mode, if encoding is not specified the encoding used is platform\n"
-"dependent. (For reading and writing raw bytes use binary mode and leave\n"
-"encoding unspecified.) The available modes are:\n"
+"dependent: locale.getpreferredencoding(False) is called to get the\n"
+"current locale encoding. (For reading and writing raw bytes use binary\n"
+"mode and leave encoding unspecified.) The available modes are:\n"
"\n"
"========= ===============================================================\n"
"Character Meaning\n"