]> granicus.if.org Git - python/commit
Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 5 Jun 2012 11:43:22 +0000 (13:43 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 5 Jun 2012 11:43:22 +0000 (13:43 +0200)
commitf86a5e8a93ab293d4cc00a8f2835d6d2cd3baa69
tree9d249e4c06f25885dc668edd529b1a4c802c898a
parent91c5a34613fb918c79bb372723e10e106ad9a9be
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.
Doc/library/functions.rst
Doc/library/io.rst
Lib/_pyio.py
Lib/test/test_builtin.py
Lib/test/test_io.py
Misc/NEWS
Modules/_io/_iomodule.c
Modules/_io/textio.c