Ronald Oussoren added the comment: The test for darwin is needed because other platforms don't support "UTF-8" as a valid LC_CTYPE name, on a recent linux box:
>>> locale.setlocale(locale.LC_CTYPE, "UTF-8") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/python2.7/lib/python2.7/locale.py", line 539, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting (And just calling setlocale to check if the value is valid is not an option because that changes process-global state) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18378> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com