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.

Author santhosh.thottingal
Recipients santhosh.thottingal
Date 2009-09-12.14:26:56
SpamBayes Score 4.0626546e-08
Marked as misclassified No
Message-id <1252765618.77.0.920082811868.issue6895@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2009-09-12 14:27:29santhosh.thottingalsetrecipients: + santhosh.thottingal
2009-09-12 14:26:58santhosh.thottingalsetmessageid: <1252765618.77.0.920082811868.issue6895@psf.upfronthosting.co.za>
2009-09-12 14:26:57santhosh.thottingallinkissue6895 messages
2009-09-12 14:26:57santhosh.thottingalcreate