STINNER Victor added the comment:

> It may be an OSX specific bug?

Yes, on Linux, it "just works":

haypo@selma$ LC_ALL=en_US python2 -c 'import io; io.open("/dev/null")'
haypo@selma$ LC_ALL=en_USxxx python2 -c 'import io; io.open("/dev/null")'

In fact, you get ASCII encoding for these two locales:

haypo@selma$ LC_ALL=en_US python2 -c 'import locale; 
print(locale.getpreferredencoding(False))'
ANSI_X3.4-1968

haypo@selma$ LC_ALL=en_USxxx python2 -c 'import locale; 
print(locale.getpreferredencoding(False))'
ANSI_X3.4-1968

Internally, io.open() uses locale.getpreferredencoding(False) if you don't 
specify an encoding.

----------
nosy: +haypo

_______________________________________
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