[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Julian Taylor
New submission from Julian Taylor : using unicode strings for locale.normalize gives following traceback with python2.7: ~$ python2.7 -c 'import locale; locale.normalize(u"en_US")' Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/locale.py", line 358, in norm

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> test needed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Julian Taylor
Julian Taylor added the comment: this is a regression introduced by fixing http://bugs.python.org/issue1813 This breaks some user code,. e.g. wx.Locale.GetCanonicalName returns unicode. Example bugs: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/824734 https://bugs.launchpad.net

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Julian Taylor wrote: > > New submission from Julian Taylor : > > using unicode strings for locale.normalize gives following traceback with > python2.7: > > ~$ python2.7 -c 'import locale; locale.normalize(u"en_US")' > Traceback (most recent call last): >

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: A cheap way of fixing this would be to test for str-ness of localename and if it's a unicode, just localname.encode('ascii') Or is that completely insane? -- nosy: +barry ___ Python tracker

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: For example: diff -r fb49394f75ed Lib/locale.py --- a/Lib/locale.py Mon Aug 15 14:24:15 2011 +0300 +++ b/Lib/locale.py Mon Aug 15 16:47:23 2011 -0400 @@ -355,6 +355,8 @@ """ # Normalize the locale name and extract the encoding +if isin

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- keywords: +patch Added file: http://bugs.python.org/file22904/issue12752.diff ___ Python tracker ___ _

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: The proposed resolution looks ok. Another possibility is simply to use .lower() if the string is an unicode string, since that will bypass the C locale. -- nosy: +pitrou stage: test needed -> patch review ___ Python

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- assignee: -> barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0d64fe6c737f by Barry Warsaw in branch '2.7': The simplest possible fix for the regression in bug 12752 by encoding unicodes http://hg.python.org/cpython/rev/0d64fe6c737f -- nosy: +python-dev ___ Python

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list