Commit 300e2b01 authored by Mark Dickinson's avatar Mark Dickinson

Issue #2173: fix build failure on OS X. device_encoding was returning an

empty string, causing an (invisible) LookupError on any attempt to write
to sys.stdout.
parent 18c3fcc7
...@@ -12,6 +12,10 @@ What's New in Python 3.1 alpha 0 ...@@ -12,6 +12,10 @@ What's New in Python 3.1 alpha 0
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #2173: When getting device encoding, check that return value of
nl_langinfo is not the empty string. This was causing silent build
failures on OS X.
- Issue #4597: Fixed several opcodes that weren't always propagating - Issue #4597: Fixed several opcodes that weren't always propagating
exceptions. exceptions.
......
...@@ -6724,7 +6724,7 @@ device_encoding(PyObject *self, PyObject *args) ...@@ -6724,7 +6724,7 @@ device_encoding(PyObject *self, PyObject *args)
#elif defined(CODESET) #elif defined(CODESET)
{ {
char *codeset = nl_langinfo(CODESET); char *codeset = nl_langinfo(CODESET);
if (codeset) if (codeset != NULL && codeset[0] != 0)
return PyUnicode_FromString(codeset); return PyUnicode_FromString(codeset);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment