Author: Amber Brown <[email protected]>
Branch:
Changeset: r82241:261c7622b920
Date: 2016-02-15 00:20 +0800
http://bitbucket.org/pypy/pypy/changeset/261c7622b920/
Log: Check for the existence of CODESET, not that it's a truthy value.
CODESET is set from langinfo.h -- the value on Linux is 14, but the
value on BSD is 0, so this should have prevented PyPy from ever
working on FreeBSD.
diff --git a/pypy/module/sys/interp_encoding.py
b/pypy/module/sys/interp_encoding.py
--- a/pypy/module/sys/interp_encoding.py
+++ b/pypy/module/sys/interp_encoding.py
@@ -42,7 +42,7 @@
def _getfilesystemencoding(space):
encoding = base_encoding
- if rlocale.HAVE_LANGINFO and rlocale.CODESET:
+ if rlocale.HAVE_LANGINFO and hasattr(rlocale, "CODESET"):
try:
oldlocale = rlocale.setlocale(rlocale.LC_CTYPE, None)
rlocale.setlocale(rlocale.LC_CTYPE, "")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit