Message92546
locale._parse_localename fails when the locale name is in xx_YY format.
For example when the system locale is Malayalam(India), ml_IN we get
the following result
>>> locale._parse_localename("ml_IN")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/python311/lib/python3.1/locale.py", line 424, in
_parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: ml_IN
The expected result is ('ml_IN', None)
For Latin languages, locale.py assumes iso-8859-15 as the encoding type
if encoding type is not given in localename. In case
of other locales, None can be returned for encoding type.
Attached patch fixes this.
The result after applying patch to locale.py
>>> import locale
>>> locale._parse_localename("ml_IN")
('ml_IN', None) |
|
Date |
User |
Action |
Args |
2009-09-12 14:27:29 | santhosh.thottingal | set | recipients:
+ santhosh.thottingal |
2009-09-12 14:26:58 | santhosh.thottingal | set | messageid: <1252765618.77.0.920082811868.issue6895@psf.upfronthosting.co.za> |
2009-09-12 14:26:57 | santhosh.thottingal | link | issue6895 messages |
2009-09-12 14:26:57 | santhosh.thottingal | create | |
|