Patches item #1158909, was opened at 2005-03-08 09:40
Message generated for change (Comment added) made by sorlov
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1158909&group_id=5470
Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Wummel (calvin)
Assigned to: Nobody/Anonymous (nobody)
Summary: patch for bug 1158490 (locale breakage)
Initial Comment:
Patch fixes the locale breakage mentioned in the bug by
using the normalized locale var. Patch is against
current CVS.
----------------------------------------------------------------------
Comment By: Serge Orlov (sorlov)
Date: 2005-03-10 13:58
Message:
Logged In: YES
user_id=1235914
There is no [EMAIL PROTECTED] because England hasn't joined EU :)
If the code that tries to guess encoding is removed it will
raise an exception:
ValueError: unknown locale: [EMAIL PROTECTED]
Like locale command line tool prints warning:
[EMAIL PROTECTED] locale charmap
locale: Cannot set LC_CTYPE to default locale: No such file
or directory
locale: Cannot set LC_MESSAGES to default locale: No such
file or directory
locale: Cannot set LC_ALL to default locale: No such file or
directory
ANSI_X3.4-1968
----------------------------------------------------------------------
Comment By: Wummel (calvin)
Date: 2005-03-09 21:35
Message:
Logged In: YES
user_id=9205
Wouldn't removing the if '@' stuff break other cases? For
example locale.normalize('[EMAIL PROTECTED]') still returns
'[EMAIL PROTECTED]'. In this case the @euro part would not get
split off and will be returned. When I understand the
documentation of getdefaultlocale() correctly, it is not
supposed to return the @euro part.
----------------------------------------------------------------------
Comment By: Serge Orlov (sorlov)
Date: 2005-03-09 20:31
Message:
Logged In: YES
user_id=1235914
I think the correct fix is to remove the whole if '@' in
code:. There is also a comment that the code under if is
bogus. The reason for the breakage is that
locale.normalize('[EMAIL PROTECTED]') started to return
de_DE.ISO8859-15
----------------------------------------------------------------------
Comment By: Wummel (calvin)
Date: 2005-03-09 19:59
Message:
Logged In: YES
user_id=9205
I forgot an example. this fails for me on current CVS:
$ env [EMAIL PROTECTED] python2.5 -c "import locale; print
locale.getdefaultlocale()"
Traceback (most recent call last):
File "<string>", line 1, in ?
File "/usr/local/lib/python2.5/locale.py", line 357, in
getdefaultlocale
return _parse_localename(localename)
File "/usr/local/lib/python2.5/locale.py", line 280, in
_parse_localename
code, modifier = code.split('@')
ValueError: need more than 1 value to unpack
The error is that the @ char is searched in the original
locale, but the split is done on the normalized locale.
Hence the unpack error.
----------------------------------------------------------------------
Comment By: Serge Orlov (sorlov)
Date: 2005-03-09 19:26
Message:
Logged In: YES
user_id=1235914
I don't get what this patch fixes. It actually changes
handling of locales with @ sign, but there is no mentioning
of that in bug 1158490. What do I miss?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1158909&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches