summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2008-12-11 18:03:03 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2008-12-11 18:03:03 (GMT)
commitda2706b28f31db11919c19cf136fddd42b9a4191 (patch)
treed96e3c5e57da7d17756f5eead0ed4df884a44b79 /Modules
parentb99d1cde075ca538a56da5c6a96a9382bbe492d2 (diff)
downloadcpython-da2706b28f31db11919c19cf136fddd42b9a4191.zip
cpython-da2706b28f31db11919c19cf136fddd42b9a4191.tar.gz
cpython-da2706b28f31db11919c19cf136fddd42b9a4191.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 3892a91..527c92a 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6724,7 +6724,7 @@ device_encoding(PyObject *self, PyObject *args)
#elif defined(CODESET)
{
char *codeset = nl_langinfo(CODESET);
- if (codeset)
+ if (codeset != NULL && codeset[0] != 0)
return PyUnicode_FromString(codeset);
}
#endif