STINNER Victor added the comment:

Thanks for your bug report Anthony Sottile! It's now fixed!


My backport was merged.

New changeset 94a3694c3dda97e3bcb51264bf47d948c5424d84 by Victor Stinner in 
branch '2.7':
bpo-6393: Fix locale.getprerredencoding() on macOS (#1555)
https://github.com/python/cpython/commit/94a3694c3dda97e3bcb51264bf47d948c5424d84

Before, without the fix:

macbook:2.7 haypo$ LANG=en_US ./python.exe -c 'import io; 
print(io.open("setup.py").encoding)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
LookupError: unknown encoding: 


After, with the fix:

macbook:2.7 haypo$ LANG=en_US ./python.exe -c 'import io; 
print(io.open("setup.py").encoding)'
UTF-8


--

Python 3.7 is not affected:

macbook:master haypo$ LANG=en_US ./python.exe -c 'import locale; 
print(locale.getpreferredencoding())'
UTF-8

macbook:master haypo$ LANG=en_US ./python.exe -c 'import io; 
print(io.open("setup.py").encoding)'
UTF-8

----------
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -Python 3.6

_______________________________________
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