STINNER Victor added the comment:

> Note that _pyio uses locale.getpreferedencoding(), not 
> locale.getpreferredencoding(False).

Oh, it's a difference between Python 2.7 and Python 3.

Python 3 calls setlocale(LC_CTYPE, "") at startup, so 
locale.getpreferredencoding(False) can be used in Python 3.

Python 2.7 requires to call locale.getpreferredencoding() to get the encoding 
of the *user* locale.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30338>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to