Browse Source
Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
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.pull/2332/head
8 changed files with 82 additions and 27 deletions
-
7Doc/library/functions.rst
-
8Doc/library/io.rst
-
4Lib/_pyio.py
-
40Lib/test/test_builtin.py
-
35Lib/test/test_io.py
-
6Misc/NEWS
-
5Modules/_io/_iomodule.c
-
4Modules/_io/textio.c
Write
Preview
Loading…
Cancel
Save
Reference in new issue