Old FreeBSD's libc has a bug relate to utf-8 locale and Python have patch for it: http://svn.python.org/view/python/trunk/Include/pyport.h? view=diff&pathrev=43219&r1=36792&r2=36793 This bug appears in Mac OS X again. This test fails: >>> s = '\xa0' >>> assert s.strip() == s >>> import locale >>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') 'en_US.UTF-8' >>> assert s.strip() == s So above patch should be enabled for Mac OS X.
I've attached a patch that fixes the issue and enables all test_locale tests on OSX 10.6. (I will test if the tests can also be enabled on 10.5 when applying the patch).