update locale aliases for glibc 2.24 #422

Merged
merged 1 commit into from Mar 8, 2017

Projects

None yet

5 participants

Contributor

I also made makelocalealias.py prefer the glibc defaults.

@benjaminp benjaminp requested a review from serhiy-storchaka Mar 3, 2017
@serhiy-storchaka

This change needs an entry in Misc/NEWS. Please open an issue on the tracker for discussion and reference.

data.update(parse(args.locale_alias))
+ data.update(parse_glibc_supported(args.glibc_supported))
serhiy-storchaka
serhiy-storchaka Mar 3, 2017 Member

Why this is changed?

benjaminp
benjaminp Mar 3, 2017 Contributor

Because some of the X11 locale aliases conflict with the glibc ones. glibc obviously uses the glibc ones. This fixes problems where we would return encodings (like en_IN.ISO8859-1) that don't correspond to the C-level one.

serhiy-storchaka
serhiy-storchaka Mar 3, 2017 Member

This is separate issue (bpo-20087). Let don't mix updating to newer glibc with changing the priority of aliases tables. The latter change needs blessing from the module maintainer.

benjaminp
benjaminp Mar 3, 2017 Contributor

IMO, this is the only interesting change. I only upgraded the alias list because finding an old version of glibc is slightly annoying and updating it is unlikely to break things.

Member

I suppose some of changes are related to bpo-20087. This was not discussed yet.

Contributor

I think this is the correct fix for bpo-29571.

Contributor
ncoghlan commented Mar 3, 2017

Aye, I never did figure out why locale.getpreferredencoding(False) and locale.getlocale(LC_CTYPE) were giving different answers - this would definitely explain it.

+1 for fixing the underlying discrepancy in 3.7+.

@benjaminp benjaminp requested a review from malemburg Mar 4, 2017
Member

@benjaminp, when you run Tools/i18n/makelocalealias.py on unmodified sources, you get also a list of modified aliases:

#    updated 'az_az' -> 'az_AZ.ISO8859-9E' to 'az_AZ.UTF-8'
#    updated 'ca_ad' -> 'ca_AD.ISO8859-1' to 'ca_AD.ISO8859-15'
#    updated 'ca_fr' -> 'ca_FR.ISO8859-1' to 'ca_FR.ISO8859-15'

It should be added to the long comment before the alias table. Only "updated" lines are needed, not "removed".

Add a comment that glibc aliases now are preferred. This is the main cause of changes.

And please add a test for en_IN.

@benjaminp benjaminp update locale aliases for glibc 2.24
I also made makelocalealias.py prefer the glibc defaults.
3738b4a
Member

Please see the ticket for discussion: http://bugs.python.org/issue20087

@benjaminp benjaminp merged commit 02371e0 into master Mar 8, 2017

1 of 3 checks passed

continuous-integration/appveyor/branch AppVeyor build failed
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@benjaminp benjaminp deleted the benjamin-locale-aliases branch Mar 8, 2017
Member

This merge should be undone. The PR clearly contains bugs and also is not complete. See the ticket for discussion.

@benjaminp benjaminp added a commit that referenced this pull request Mar 19, 2017
@benjaminp benjaminp bpo-20087: Revert "make the glibc alias table take precedence over th…
…e X11 one (#422)"

This reverts commit 02371e0.
ce9fff3
@benjaminp benjaminp added a commit that referenced this pull request Mar 19, 2017
@benjaminp benjaminp bpo-20087: Revert "make the glibc alias table take precedence over th…
…e X11 one (#422)"

This reverts commit 02371e0.
6b6cdc2
@benjaminp benjaminp added a commit that referenced this pull request Mar 19, 2017
@benjaminp benjaminp bpo-20087: Revert "make the glibc alias table take precedence over th…
…e X11 one (#422)"

This reverts commit 02371e0.
65d7377
@benjaminp benjaminp added a commit that referenced this pull request Mar 20, 2017
@benjaminp benjaminp bpo-20087: Revert "make the glibc alias table take precedence over th…
…e X11 one (#422)"

This reverts commit 02371e0.
1831996
@benjaminp benjaminp added a commit that referenced this pull request Mar 20, 2017
@benjaminp benjaminp Revert "bpo-20087: Revert "make the glibc alias table take precedence…
… over the X11 one (#422)" (#713)"

This reverts commit df82808.
0c92b00
@benjaminp benjaminp added a commit that referenced this pull request Mar 20, 2017
@benjaminp benjaminp bpo-20087: Revert "make the glibc alias table take precedence over th…
…e X11 one (#422)" (#713)

This reverts commit 02371e0.
df82808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment