[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2014-01-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: locale.normalize() was fixed in issue5815 (and new entry for 'sr_RS.UTF-8@latin' is not needed anymore). Devanagari entries were fixed in issue20027. In any case thank you Mike for your report and proposed patch. -- resolution: -> duplicate stage:

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems this is a duplicate of issue5815. -- nosy: +serhiy.storchaka superseder: -> locale.getdefaultlocale() missing corner case ___ Python tracker __

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Mike FABIAN
Mike FABIAN added the comment: The patch http://bugs.python.org/file32552/0001-Issue-19534-fix-normalize-in-locale.py-to-make-it-wo.patch is against the current HEAD of the 2.7 branch, but Python 3.3 has exactly the same problem, the same patch fixes it for python 3.3 as well. --

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Mike FABIAN
Mike FABIAN added the comment: I think the patch I attach here is a better fix than the patch in http://bugs.python.org/msg202469 because it makes the normalize() function behave more logical overall, with this patch, my test program prints: mfabian@ari:/local/mfabian/src/cpython (2.7-mike %) $

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Mike FABIAN
Mike FABIAN added the comment: in locale.py, the comment above “locale_alias = {” says: # Note that the normalize() function which uses this tables # removes '_' and '-' characters from the encoding part of the # locale name before doing the lookup. This saves a lot of # space in the table. But

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Mike FABIAN
Mike FABIAN added the comment: A simple fix for that problem could look like this: mfabian@ari:~ $ diff -u /usr/lib64/python2.7/locale.py.orig /usr/lib64/python2.7/locale.py --- /usr/lib64/python2.7/locale.py.orig 2013-11-09 09:08:24.807331535 +0100 +++ /usr/lib64/python2.7/locale.py 2013-1

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Mike FABIAN
Mike FABIAN added the comment: The problem turns out to be caused by a problem in normalizing the locale name, see the output of this test program: mfabian@ari:~ $ cat ~/tmp/mike-test.py #!/usr/bin/python2 import sys import os import locale import encodings import encodings.aliases test_local

[issue19534] normalize() in locale.py fails for sr_RS.UTF-8@latin

2013-11-09 Thread Mike FABIAN
New submission from Mike FABIAN: Originally reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1024667 I found that Serbian translations in Latin do not work when the locale name is written as sr_RS.UTF-8@latin (one gets the cyrillic translations instead), but they *do* work when the l