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.

classification
Title: Add es_cu to locale aliases
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Add support for glibc supported locales
View: 20079
Assigned To: Nosy List: Leiser.Fernández.Gallo, benjamin.peterson, berker.peksag, doerwalter, eric.araujo, lemburg, loewis, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2012-11-26 01:24 by Leiser.Fernández.Gallo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue16555.diff berker.peksag, 2012-12-07 09:28 review
Messages (15)
msg176392 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2012-11-26 03:22
Python 2.7 is in bugfix-only mode.
msg176395 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-11-26 04:54
Could you expand on the feature request?  The Python locale module delegates to the operating system’s locale system; to the best of my knowledge there is no registry of locale names at the Python level.
msg176435 - (view) Author: Leiser Fernández Gallo (Leiser.Fernández.Gallo) Date: 2012-11-26 17:39
In the file locale.py there is a var locale_alias that map the locale names, es_cu isn't there.
msg176484 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-11-27 17:33
Ah, ok.  Sounds good to me.

(I think this can go in stable branches, like other update to registries (e.g. mimetypes), but other core devs may disagree.)
msg177117 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-12-07 19:49
LGTM.
msg181041 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2013-01-31 19:05
> LGTM.

Thanks for the review, Éric. Do you have time to commit the patch?
msg181098 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-02-01 19:16
I have a busy week-end ahead but I could sneak a little time for this.
msg181328 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-02-04 14:44
Benjamin, does this have to wait for 2.7.5?
msg181329 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-02-04 14:46
Is there some sort of reference for these aliases? Where do they come from?
msg181393 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-02-04 22:26
They come from the X.org project.  See comments in http://hg.python.org/cpython/file/default/Lib/locale.py#l601

I had forgotten there was a makelocalealias.py script; maybe we could run it instead of adding an entry manually.
msg181394 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-02-04 22:37
Yes, please. See what makelocalealias.py does.
msg181396 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2013-02-04 22:45
Éric Araujo wrote:
> 
> Éric Araujo added the comment:
> 
> They come from the X.org project.  See comments in http://hg.python.org/cpython/file/default/Lib/locale.py#l601
> 
> I had forgotten there was a makelocalealias.py script; maybe we could run it instead of adding an entry manually.

Hi Eric,

let me know if you need help with the script.
msg181400 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2013-02-05 00:25
The es_CU locale has been added to GNU libc (in version 2.15)[1], but
Tools/i18n/makelocalealias.py script uses the /usr/share/X11/locale/locale.alias file to generate the locale_alias dictionary. I think
/usr/share/X11/locale/locale.alias needs to be updated to recognize
the new GNU libc locales.

See for more information:

* https://bugs.freedesktop.org/show_bug.cgi?id=1544
* http://translate.sourceforge.net/wiki/guide/locales_x11

[1] http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=1eb0b490809a681ea801a1cbd93df5b51a4a47e0;hp=c24a9a8aaea37ac630611eb2c75a6517802a1a9d
msg181409 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-02-05 03:08
On Debian testing, I get a few changes that look like fixes but not es_CU yet:

@@ -807,0 +818,1 @@ locale_alias = {
+    'bokm\xef\xbf\xbd':                     'nb_NO.ISO8859-1',
@@ -822,0 +834,1 @@ locale_alias = {
+    'c.ascii':                              'C',
@@ -936,0 +949,3 @@ locale_alias = {
+    'en_dk':                                'en_DK.ISO8859-1',
+    'en_dk.iso88591':                       'en_DK.ISO8859-1',
+    'en_dk.iso885915':                      'en_DK.ISO8859-15',
@@ -976,1 +991,1 @@ locale_alias = {
-    'english.iso88591':                     'en_EN.ISO8859-1',
+    'english.iso88591':                     'en_US.ISO8859-1',
@@ -1114,0 +1130,1 @@ locale_alias = {
+    'fran\xef\xbf\xbdis':                   'fr_FR.ISO8859-1',
@@ -1164,2 +1180,2 @@ locale_alias = {
-    'hebrew':                               'iw_IL.ISO8859-8',
-    'hebrew.iso88598':                      'iw_IL.ISO8859-8',
+    'hebrew':                               'he_IL.ISO8859-8',
+    'hebrew.iso88598':                      'he_IL.ISO8859-8',
@@ -1246,0 +1263,1 @@ locale_alias = {
+    'km':                                   'km_KH.UTF-8',
@@ -1413,1 +1430,1 @@ locale_alias = {
-    'russian':                              'ru_RU.ISO8859-5',
+    'russian':                              'ru_RU.KOI8-R',
@@ -1427,0 +1445,1 @@ locale_alias = {
+    'sid_et':                               'sid_ET.UTF-8',

I could hunt down the very latest upstream X.org locale.alias file and try the script again.  And/or we can do this one addition (es_CU) now, unless there are issues with Python recognizing a locale that the OS doesn’t know about yet.


MAL: the script needed no change at all to find the file and run! :)  We could make it more similar to token/keyword/etc and have it update locale.py in 3.4+.  Also maybe make updating the aliases a part of feature release workflow, or even bugfix releases.
msg227946 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-30 15:42
This issue is superseded by issue20079.
History
Date User Action Args
2022-04-11 14:57:38adminsetgithub: 60759
2014-10-01 21:34:22serhiy.storchakasetstatus: pending -> closed
resolution: duplicate
stage: patch review -> resolved
2014-09-30 15:42:29serhiy.storchakasetstatus: open -> pending

nosy: + serhiy.storchaka
messages: + msg227946

superseder: Add support for glibc supported locales
2013-02-05 03:08:54eric.araujosetmessages: + msg181409
2013-02-05 00:25:44berker.peksagsetmessages: + msg181400
2013-02-04 22:45:54lemburgsetmessages: + msg181396
2013-02-04 22:37:39benjamin.petersonsetmessages: + msg181394
2013-02-04 22:26:31eric.araujosetmessages: + msg181393
2013-02-04 14:46:13benjamin.petersonsetmessages: + msg181329
2013-02-04 14:44:14eric.araujosetnosy: + benjamin.peterson
messages: + msg181328
2013-02-01 19:16:44eric.araujosetnosy: + doerwalter
messages: + msg181098
2013-01-31 19:05:25berker.peksagsetmessages: + msg181041
2012-12-15 18:57:30pitrousetstage: patch review
2012-12-07 19:49:22eric.araujosetmessages: + msg177117
2012-12-07 09:28:19berker.peksagsetfiles: + issue16555.diff
keywords: + patch
2012-11-27 17:33:00eric.araujosetnosy: + lemburg, loewis
title: Add es_cu to locale library. -> Add es_cu to locale aliases
messages: + msg176484

versions: + Python 3.2, Python 3.3, Python 3.4
2012-11-26 17:39:48Leiser.Fernández.Gallosetmessages: + msg176435
versions: + Python 2.7, - Python 3.4
2012-11-26 04:54:30eric.araujosetnosy: + eric.araujo
messages: + msg176395
2012-11-26 03:22:23berker.peksagsetnosy: + berker.peksag

messages: + msg176392
versions: + Python 3.4, - Python 2.7
2012-11-26 01:24:47Leiser.Fernández.Gallocreate