Bugs item #1080864, was opened at 2004-12-07 21:23 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1080864&group_id=5470
Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: stas Z (childsplay) Assigned to: Nobody/Anonymous (nobody) Summary: locale.py doesn't recognize valid locale setting Initial Comment: [EMAIL PROTECTED]:~$ locale LANG=nb_NO [...] [EMAIL PROTECTED]:~$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09) [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getdefaultlocale() Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/locale.py", line 346, in getdefaultlocale return _parse_localename(localename) File "/usr/lib/python2.3/locale.py", line 280, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: nb_NO >>> ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2004-12-07 23:13 Message: Logged In: YES user_id=21627 To get the default encoding for the current locale, you should use locale.getpreferredencoding(). You should not use getdefaultlocale becaus it is (IMO) inherently broken, and should not have been part of the standard library in the first place. ---------------------------------------------------------------------- Comment By: Jarek Zgoda (zgoda) Date: 2004-12-07 22:39 Message: Logged In: YES user_id=92222 getdefaultlocale() is often used to get default encoding for current system locale. And, if function is provided in standard library, why shouldn't one use it? ---------------------------------------------------------------------- Comment By: Martin v. Löwis (loewis) Date: 2004-12-07 21:25 Message: Logged In: YES user_id=21627 Why do you want to use getdefaultlocale()? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1080864&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com