Hide Forgot
Description of problem: According to pydoc locale function setlocale should setlocale(category, locale=None) Set the locale for the given category. The locale can be a string, a locale tuple (language code, encoding), or None. Locale tuples are converted to strings the locale aliasing engine. Locale strings are passed directly to the C lib. category may be given as one of the LC_* values. However, when I try to run locale.setlocale(locale.LC_ALL, ("cs_CZ", "utf-8")) (which works perfectly well on RHEL 6, and Fedoras), I get this backtrace [mcepl@shell ~]$ python Python 2.4.3 (#1, Aug 29 2011, 10:55:55) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL, ("cs_CZ", "utf-8")) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib64/python2.4/locale.py", line 381, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting >>> Version-Release number of selected component (if applicable): python-2.4.3-44.el5_7.1.x86_64 How reproducible: 100% Steps to Reproduce: 1.see above 2. 3. Actual results: backtrace Expected results: locale set, function returns the new locale label Additional info: There is a simple workaround. Check with locale -a what values can locale string get and then run classical string version of the call (for example) locale.setlocale(locale.LC_ALL, "cs_CZ.utf8") However, this call is completely system dependent (and doesn't work on other platforms).
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.