New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locale.getdefaultlocale doesnt handle all locales gracefully #39317
Comments
[forwarded from http://bugs.debian.org/185776] $ LC_ALL=en_ZA python
Python 2.3.1 (#2, Sep 24 2003, 11:39:14)
[GCC 3.3.2 20030908 (Debian prerelease)] 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: en_ZA Note that locale.getlocale correctly returns (None, None) locale.getdefaultlocale() calls _parse_localename, If this behaviour in python is "as it should be", The problem might be (depending on "specifications") |
Logged In: YES This is a known limitation: getdefaultlocale should not be If the intention is to compute the locale's encoding, |
Logged In: YES http://python.org/sf/504219 seems to be the same bug. |
Logged In: YES Closing as duplicate of bpo-504219. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: