[issue6895] locale._parse_localename fails when localename does not contain encoding information

2010-02-13 Thread Santhosh Thottingal

Santhosh Thottingal  added the comment:

I see that the ml_IN added to locale.alias of X.org. 
lemburg, Do you think that my patch is still required as a fallback solution in 
case xx_YY mapping not found in locale.alias? 
If you can confirm that it is not required, we can close this bug.

--

___
Python tracker 
<http://bugs.python.org/issue6895>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-09-12 Thread Santhosh Thottingal

New submission from Santhosh Thottingal :

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 "", line 1, in 
  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)

--
components: Library (Lib)
files: locale.py-parselocale-patch.diff
keywords: patch
messages: 92546
nosy: santhosh.thottingal
severity: normal
status: open
title: locale._parse_localename fails when localename does not contain encoding 
information
type: crash
versions: Python 3.1
Added file: http://bugs.python.org/file14881/locale.py-parselocale-patch.diff

___
Python tracker 
<http://bugs.python.org/issue6895>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6895] locale._parse_localename fails when localename does not contain encoding information

2009-09-17 Thread Santhosh Thottingal

Santhosh Thottingal  added the comment:

Attached the testcases as a patch to Lib/test/test_locale.py

--
Added file: http://bugs.python.org/file14915/test_locale.py.diff

___
Python tracker 
<http://bugs.python.org/issue6895>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com