This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2003年09月27日 08:54 by doko, last changed 2022年04月10日 16:11 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg18402 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2003年09月27日 08:54 | |
[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, which throws a ValueError if normalize e.g. does not return an encoding. If this behaviour in python is "as it should be", locale.getdefaultlocale should document it as such, to make it clear to apps using getdefaultlocale that they *must indeed* handle such an exception gracefully. (In this case, it could probably be a "normal" bug, then the "important" bug belongs with apt-listchanges.) The problem might be (depending on "specifications") either getlocale returning ValueError in the "unknown" case, or it could be because locale_alias does not contain an entry for en_ZA... |
|||
| msg18403 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2003年10月04日 08:06 | |
Logged In: YES user_id=21627 This is a known limitation: getdefaultlocale should not be used in new code. If the intention is to compute the locale's encoding, locale.getpreferredencoding should be used instead. |
|||
| msg18404 - (view) | Author: Johannes Gijsbers (jlgijsbers) * (Python triager) | Date: 2004年11月08日 18:59 | |
Logged In: YES user_id=469548 http://python.org/sf/504219 seems to be the same bug. |
|||
| msg18405 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2006年02月20日 19:08 | |
Logged In: YES user_id=849994 Closing as duplicate of #504219. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月10日 16:11:25 | admin | set | github: 39317 |
| 2009年02月13日 02:24:59 | ajaksu2 | link | issue504219 dependencies |
| 2003年09月27日 08:54:36 | doko | create | |