Bugs item #1703592, was opened at 2007-04-19 15:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1703592&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Extension Modules Group: Python 2.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Matthias Klose (doko) Assigned to: Martin v. Löwis (loewis) Summary: have a way to ignore nonexisting locales in locale.setlocale Initial Comment: this came up on #ubuntu-devel; Debian and Ubuntu do not generate all libc locales by default, so it is likely that $ LC_ALL=en_US.UTF-8 python -c "import locale; locale.setlocale(locale.LC_ALL, '')" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.5/locale.py", line 476, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting fails on a system (often experienced ssh'ing into a server system where your current locale doesn't exist). Examples for bug reports in various applications are: https://launchpad.net/bugs/91583 (apt-listchanges) https://launchpad.net/bugs/88638 (pitivi) https://launchpad.net/bugs/81556 (exaile) https://launchpad.net/bugs/90525 (hwdb-client) In C, the result of the setlocale(3) call can be, and usually is ignored, if the locale cannot be set. It is argued that the Python interface for locale.setlocale() should not raise an exception by default, if the locale is missing on the system. That would be an behaviour change of locale.setlocale(), so the original behavour should be kept as an option (introducing an optional third parameter to raise the exception when the locale doesn't exist). Is this an appropriate change, or could another change be suggested? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1703592&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com