[Python-checkins] [2.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. (GH-6708). (GH-6717)
Serhiy Storchaka
webhook-mailer at python.org
Sun May 6 03:51:52 EDT 2018
https://github.com/python/cpython/commit/a55ac801f749a731250f3c7c1db7d546d22ae032
commit: a55ac801f749a731250f3c7c1db7d546d22ae032
branch: 2.7
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-05-06T10:51:49+03:00
summary:
[2.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. (GH-6708). (GH-6717)
(cherry picked from commit cedc9b74202d8c1ae39bca261cbb45d42ed54d45)
files:
A Misc/NEWS.d/next/Library/2018-05-05-18-02-24.bpo-20087.lJrvXL.rst
M Lib/locale.py
M Lib/test/test_locale.py
diff --git a/Lib/locale.py b/Lib/locale.py
index 62aad5ae7bf9..51909f81e734 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -798,6 +798,17 @@ def getpreferredencoding(do_setlocale = True):
#
# SS 2014-10-01:
# Updated alias mapping with glibc 2.19 supported locales.
+#
+# SS 2018-05-05:
+# Updated alias mapping with glibc 2.27 supported locales.
+#
+# These are the differences compared to the old mapping (Python 2.7.15
+# and older):
+#
+# updated 'ca_es at valencia' -> 'ca_ES.ISO8859-15 at valencia' to 'ca_ES.UTF-8 at valencia'
+# updated 'english.iso88591' -> 'en_EN.ISO8859-1' to 'en_US.ISO8859-1'
+# updated 'kk_kz' -> 'kk_KZ.RK1048' to 'kk_KZ.ptcp154'
+# updated 'russian' -> 'ru_RU.ISO8859-5' to 'ru_RU.KOI8-R'
locale_alias = {
'a3': 'az_AZ.KOI8-C',
@@ -810,11 +821,14 @@ def getpreferredencoding(do_setlocale = True):
'af': 'af_ZA.ISO8859-1',
'af_za': 'af_ZA.ISO8859-1',
'af_za.iso88591': 'af_ZA.ISO8859-1',
+ 'agr_pe': 'agr_PE.UTF-8',
+ 'ak_gh': 'ak_GH.UTF-8',
'am': 'am_ET.UTF-8',
'am_et': 'am_ET.UTF-8',
'american': 'en_US.ISO8859-1',
'american.iso88591': 'en_US.ISO8859-1',
'an_es': 'an_ES.ISO8859-15',
+ 'anp_in': 'anp_IN.UTF-8',
'ar': 'ar_AA.ISO8859-6',
'ar_aa': 'ar_AA.ISO8859-6',
'ar_aa.iso88596': 'ar_AA.ISO8859-6',
@@ -847,6 +861,7 @@ def getpreferredencoding(do_setlocale = True):
'ar_sa.iso88596': 'ar_SA.ISO8859-6',
'ar_sd': 'ar_SD.ISO8859-6',
'ar_sd.iso88596': 'ar_SD.ISO8859-6',
+ 'ar_ss': 'ar_SS.UTF-8',
'ar_sy': 'ar_SY.ISO8859-6',
'ar_sy.iso88596': 'ar_SY.ISO8859-6',
'ar_tn': 'ar_TN.ISO8859-6',
@@ -862,6 +877,7 @@ def getpreferredencoding(do_setlocale = True):
'az': 'az_AZ.ISO8859-9E',
'az_az': 'az_AZ.ISO8859-9E',
'az_az.iso88599e': 'az_AZ.ISO8859-9E',
+ 'az_ir': 'az_IR.UTF-8',
'be': 'be_BY.CP1251',
'be at latin': 'be_BY.UTF-8 at latin',
'be_bg.utf8': 'bg_BG.UTF-8',
@@ -879,7 +895,10 @@ def getpreferredencoding(do_setlocale = True):
'bg_bg.iso88595': 'bg_BG.ISO8859-5',
'bg_bg.koi8r': 'bg_BG.KOI8-R',
'bg_bg.microsoftcp1251': 'bg_BG.CP1251',
+ 'bhb_in.utf8': 'bhb_IN.UTF-8',
'bho_in': 'bho_IN.UTF-8',
+ 'bho_np': 'bho_NP.UTF-8',
+ 'bi_vu': 'bi_VU.UTF-8',
'bn_bd': 'bn_BD.UTF-8',
'bn_in': 'bn_IN.UTF-8',
'bo_cn': 'bo_CN.UTF-8',
@@ -921,8 +940,8 @@ def getpreferredencoding(do_setlocale = True):
'ca_es.iso885915': 'ca_ES.ISO8859-15',
'ca_es.iso885915 at euro': 'ca_ES.ISO8859-15',
'ca_es.utf8 at euro': 'ca_ES.UTF-8',
- 'ca_es at valencia': 'ca_ES.ISO8859-15 at valencia',
'ca_es at euro': 'ca_ES.ISO8859-15',
+ 'ca_es at valencia': 'ca_ES.UTF-8 at valencia',
'ca_fr': 'ca_FR.ISO8859-1',
'ca_fr.iso88591': 'ca_FR.ISO8859-1',
'ca_fr.iso885915': 'ca_FR.ISO8859-15',
@@ -936,10 +955,14 @@ def getpreferredencoding(do_setlocale = True):
'ca_it.utf8 at euro': 'ca_IT.UTF-8',
'ca_it at euro': 'ca_IT.ISO8859-15',
'catalan': 'ca_ES.ISO8859-1',
+ 'ce_ru': 'ce_RU.UTF-8',
'cextend': 'en_US.ISO8859-1',
'cextend.en': 'en_US.ISO8859-1',
'chinese-s': 'zh_CN.eucCN',
'chinese-t': 'zh_TW.eucTW',
+ 'chr_us': 'chr_US.UTF-8',
+ 'ckb_iq': 'ckb_IQ.UTF-8',
+ 'cmn_tw': 'cmn_TW.UTF-8',
'crh_ua': 'crh_UA.UTF-8',
'croatian': 'hr_HR.ISO8859-2',
'cs': 'cs_CZ.ISO8859-2',
@@ -996,6 +1019,7 @@ def getpreferredencoding(do_setlocale = True):
'de_de.iso885915 at euro': 'de_DE.ISO8859-15',
'de_de.utf8 at euro': 'de_DE.UTF-8',
'de_de at euro': 'de_DE.ISO8859-15',
+ 'de_it': 'de_IT.ISO8859-1',
'de_li.utf8': 'de_LI.UTF-8',
'de_lu': 'de_LU.ISO8859-1',
'de_lu.iso88591': 'de_LU.ISO8859-1',
@@ -1030,6 +1054,8 @@ def getpreferredencoding(do_setlocale = True):
'en_ca': 'en_CA.ISO8859-1',
'en_ca.iso88591': 'en_CA.ISO8859-1',
'en_dk': 'en_DK.ISO8859-1',
+ 'en_dk.iso88591': 'en_DK.ISO8859-1',
+ 'en_dk.iso885915': 'en_DK.ISO8859-15',
'en_dl.utf8': 'en_DL.UTF-8',
'en_gb': 'en_GB.ISO8859-1',
'en_gb.88591': 'en_GB.ISO8859-1',
@@ -1044,12 +1070,14 @@ def getpreferredencoding(do_setlocale = True):
'en_ie.iso885915 at euro': 'en_IE.ISO8859-15',
'en_ie.utf8 at euro': 'en_IE.UTF-8',
'en_ie at euro': 'en_IE.ISO8859-15',
+ 'en_il': 'en_IL.UTF-8',
'en_in': 'en_IN.ISO8859-1',
'en_ng': 'en_NG.UTF-8',
'en_nz': 'en_NZ.ISO8859-1',
'en_nz.iso88591': 'en_NZ.ISO8859-1',
'en_ph': 'en_PH.ISO8859-1',
'en_ph.iso88591': 'en_PH.ISO8859-1',
+ 'en_sc.utf8': 'en_SC.UTF-8',
'en_sg': 'en_SG.ISO8859-1',
'en_sg.iso88591': 'en_SG.ISO8859-1',
'en_uk': 'en_GB.ISO8859-1',
@@ -1073,7 +1101,7 @@ def getpreferredencoding(do_setlocale = True):
'eng_gb': 'en_GB.ISO8859-1',
'eng_gb.8859': 'en_GB.ISO8859-1',
'english': 'en_EN.ISO8859-1',
- 'english.iso88591': 'en_EN.ISO8859-1',
+ 'english.iso88591': 'en_US.ISO8859-1',
'english_uk': 'en_GB.ISO8859-1',
'english_uk.8859': 'en_GB.ISO8859-1',
'english_united-states': 'en_US.ISO8859-1',
@@ -1268,6 +1296,7 @@ def getpreferredencoding(do_setlocale = True):
'gv_gb.iso885915': 'gv_GB.ISO8859-15',
'gv_gb at euro': 'gv_GB.ISO8859-15',
'ha_ng': 'ha_NG.UTF-8',
+ 'hak_tw': 'hak_TW.UTF-8',
'he': 'he_IL.ISO8859-8',
'he_il': 'he_IL.ISO8859-8',
'he_il.cp1255': 'he_IL.CP1255',
@@ -1278,6 +1307,7 @@ def getpreferredencoding(do_setlocale = True):
'hi': 'hi_IN.ISCII-DEV',
'hi_in': 'hi_IN.ISCII-DEV',
'hi_in.isciidev': 'hi_IN.ISCII-DEV',
+ 'hif_fj': 'hif_FJ.UTF-8',
'hne': 'hne_IN.UTF-8',
'hne_in': 'hne_IN.UTF-8',
'hr': 'hr_HR.ISO8859-2',
@@ -1361,7 +1391,8 @@ def getpreferredencoding(do_setlocale = True):
'ka_ge.georgianacademy': 'ka_GE.GEORGIAN-ACADEMY',
'ka_ge.georgianps': 'ka_GE.GEORGIAN-PS',
'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY',
- 'kk_kz': 'kk_KZ.RK1048',
+ 'kab_dz': 'kab_DZ.UTF-8',
+ 'kk_kz': 'kk_KZ.ptcp154',
'kl': 'kl_GL.ISO8859-1',
'kl_gl': 'kl_GL.ISO8859-1',
'kl_gl.iso88591': 'kl_GL.ISO8859-1',
@@ -1379,6 +1410,7 @@ def getpreferredencoding(do_setlocale = True):
'korean.euc': 'ko_KR.eucKR',
'ks': 'ks_IN.UTF-8',
'ks_in': 'ks_IN.UTF-8',
+ 'ks_in.utf8 at devanagari': 'ks_IN.UTF-8 at devanagari',
'ks_in at devanagari': 'ks_IN.UTF-8 at devanagari',
'ks_in at devanagari.utf8': 'ks_IN.UTF-8 at devanagari',
'ku_tr': 'ku_TR.ISO8859-9',
@@ -1396,6 +1428,7 @@ def getpreferredencoding(do_setlocale = True):
'li_nl': 'li_NL.UTF-8',
'lij_it': 'lij_IT.UTF-8',
'lithuanian': 'lt_LT.ISO8859-13',
+ 'ln_cd': 'ln_CD.UTF-8',
'lo': 'lo_LA.MULELAO-1',
'lo_la': 'lo_LA.MULELAO-1',
'lo_la.cp1133': 'lo_LA.IBM-CP1133',
@@ -1409,14 +1442,19 @@ def getpreferredencoding(do_setlocale = True):
'lv_lv': 'lv_LV.ISO8859-13',
'lv_lv.iso885913': 'lv_LV.ISO8859-13',
'lv_lv.iso88594': 'lv_LV.ISO8859-4',
+ 'lzh_tw': 'lzh_TW.UTF-8',
'mag_in': 'mag_IN.UTF-8',
'mai': 'mai_IN.UTF-8',
'mai_in': 'mai_IN.UTF-8',
+ 'mai_np': 'mai_NP.UTF-8',
+ 'mfe_mu': 'mfe_MU.UTF-8',
'mg_mg': 'mg_MG.ISO8859-15',
'mhr_ru': 'mhr_RU.UTF-8',
'mi': 'mi_NZ.ISO8859-1',
'mi_nz': 'mi_NZ.ISO8859-1',
'mi_nz.iso88591': 'mi_NZ.ISO8859-1',
+ 'miq_ni': 'miq_NI.UTF-8',
+ 'mjw_in': 'mjw_IN.UTF-8',
'mk': 'mk_MK.ISO8859-5',
'mk_mk': 'mk_MK.ISO8859-5',
'mk_mk.cp1251': 'mk_MK.CP1251',
@@ -1435,7 +1473,7 @@ def getpreferredencoding(do_setlocale = True):
'mt_mt': 'mt_MT.ISO8859-3',
'mt_mt.iso88593': 'mt_MT.ISO8859-3',
'my_mm': 'my_MM.UTF-8',
- 'nan_tw at latin': 'nan_TW.UTF-8 at latin',
+ 'nan_tw': 'nan_TW.UTF-8',
'nb': 'nb_NO.ISO8859-1',
'nb_no': 'nb_NO.ISO8859-1',
'nb_no.88591': 'nb_NO.ISO8859-1',
@@ -1509,6 +1547,8 @@ def getpreferredencoding(do_setlocale = True):
'pa_in': 'pa_IN.UTF-8',
'pa_pk': 'pa_PK.UTF-8',
'pap_an': 'pap_AN.UTF-8',
+ 'pap_aw': 'pap_AW.UTF-8',
+ 'pap_cw': 'pap_CW.UTF-8',
'pd': 'pd_US.ISO8859-1',
'pd_de': 'pd_DE.ISO8859-1',
'pd_de.iso88591': 'pd_DE.ISO8859-1',
@@ -1549,6 +1589,8 @@ def getpreferredencoding(do_setlocale = True):
'pt_pt.iso885915 at euro': 'pt_PT.ISO8859-15',
'pt_pt.utf8 at euro': 'pt_PT.UTF-8',
'pt_pt at euro': 'pt_PT.ISO8859-15',
+ 'quz_pe': 'quz_PE.UTF-8',
+ 'raj_in': 'raj_IN.UTF-8',
'ro': 'ro_RO.ISO8859-2',
'ro_ro': 'ro_RO.ISO8859-2',
'ro_ro.iso88592': 'ro_RO.ISO8859-2',
@@ -1565,7 +1607,7 @@ def getpreferredencoding(do_setlocale = True):
'ru_ua.koi8u': 'ru_UA.KOI8-U',
'ru_ua.microsoftcp1251': 'ru_UA.CP1251',
'rumanian': 'ro_RO.ISO8859-2',
- 'russian': 'ru_RU.ISO8859-5',
+ 'russian': 'ru_RU.KOI8-R',
'rw': 'rw_RW.ISO8859-1',
'rw_rw': 'rw_RW.ISO8859-1',
'rw_rw.iso88591': 'rw_RW.ISO8859-1',
@@ -1575,17 +1617,20 @@ def getpreferredencoding(do_setlocale = True):
'sd': 'sd_IN.UTF-8',
'sd at devanagari': 'sd_IN.UTF-8 at devanagari',
'sd_in': 'sd_IN.UTF-8',
+ 'sd_in.utf8 at devanagari': 'sd_IN.UTF-8 at devanagari',
'sd_in at devanagari': 'sd_IN.UTF-8 at devanagari',
'sd_in at devanagari.utf8': 'sd_IN.UTF-8 at devanagari',
'sd_pk': 'sd_PK.UTF-8',
'se_no': 'se_NO.UTF-8',
'serbocroatian': 'sr_RS.UTF-8 at latin',
+ 'sgs_lt': 'sgs_LT.UTF-8',
'sh': 'sr_RS.UTF-8 at latin',
'sh_ba.iso88592 at bosnia': 'sr_CS.ISO8859-2',
'sh_hr': 'sh_HR.ISO8859-2',
'sh_hr.iso88592': 'hr_HR.ISO8859-2',
'sh_sp': 'sr_CS.ISO8859-2',
'sh_yu': 'sr_RS.UTF-8 at latin',
+ 'shn_mm': 'shn_MM.UTF-8',
'shs_ca': 'shs_CA.UTF-8',
'si': 'si_LK.UTF-8',
'si_lk': 'si_LK.UTF-8',
@@ -1601,6 +1646,7 @@ def getpreferredencoding(do_setlocale = True):
'slovak': 'sk_SK.ISO8859-2',
'slovene': 'sl_SI.ISO8859-2',
'slovenian': 'sl_SI.ISO8859-2',
+ 'sm_ws': 'sm_WS.UTF-8',
'so_dj': 'so_DJ.ISO8859-1',
'so_et': 'so_ET.UTF-8',
'so_ke': 'so_KE.ISO8859-1',
@@ -1627,6 +1673,7 @@ def getpreferredencoding(do_setlocale = True):
'sr_cs at latn': 'sr_CS.UTF-8 at latin',
'sr_me': 'sr_ME.UTF-8',
'sr_rs': 'sr_RS.UTF-8',
+ 'sr_rs.utf8 at latn': 'sr_RS.UTF-8 at latin',
'sr_rs at latin': 'sr_RS.UTF-8 at latin',
'sr_rs at latn': 'sr_RS.UTF-8 at latin',
'sr_sp': 'sr_CS.ISO8859-2',
@@ -1668,6 +1715,7 @@ def getpreferredencoding(do_setlocale = True):
'ta_in.tscii': 'ta_IN.TSCII-0',
'ta_in.tscii0': 'ta_IN.TSCII-0',
'ta_lk': 'ta_LK.UTF-8',
+ 'tcy_in.utf8': 'tcy_IN.UTF-8',
'te': 'te_IN.UTF-8',
'te_in': 'te_IN.UTF-8',
'tg': 'tg_TJ.KOI8-C',
@@ -1679,6 +1727,7 @@ def getpreferredencoding(do_setlocale = True):
'th_th.tactis': 'th_TH.TIS620',
'th_th.tis620': 'th_TH.TIS620',
'thai': 'th_TH.ISO8859-11',
+ 'the_np': 'the_NP.UTF-8',
'ti_er': 'ti_ER.UTF-8',
'ti_et': 'ti_ET.UTF-8',
'tig_er': 'tig_ER.UTF-8',
@@ -1689,6 +1738,8 @@ def getpreferredencoding(do_setlocale = True):
'tn': 'tn_ZA.ISO8859-15',
'tn_za': 'tn_ZA.ISO8859-15',
'tn_za.iso885915': 'tn_ZA.ISO8859-15',
+ 'to_to': 'to_TO.UTF-8',
+ 'tpi_pg': 'tpi_PG.UTF-8',
'tr': 'tr_TR.ISO8859-9',
'tr_cy': 'tr_CY.ISO8859-9',
'tr_tr': 'tr_TR.ISO8859-9',
@@ -1750,6 +1801,7 @@ def getpreferredencoding(do_setlocale = True):
'yi_us.microsoftcp1255': 'yi_US.CP1255',
'yo_ng': 'yo_NG.UTF-8',
'yue_hk': 'yue_HK.UTF-8',
+ 'yuw_pg': 'yuw_PG.UTF-8',
'zh': 'zh_CN.eucCN',
'zh_cn': 'zh_CN.gb2312',
'zh_cn.big5': 'zh_TW.big5',
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 563ddb144fbb..6070882a37f7 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -425,7 +425,7 @@ def test_latin_modifier(self):
def test_valencia_modifier(self):
self.check('ca_ES.UTF-8 at valencia', 'ca_ES.UTF-8 at valencia')
- self.check('ca_ES at valencia', 'ca_ES.ISO8859-15 at valencia')
+ self.check('ca_ES at valencia', 'ca_ES.UTF-8 at valencia')
self.check('ca at valencia', 'ca_ES.ISO8859-1 at valencia')
def test_devanagari_modifier(self):
diff --git a/Misc/NEWS.d/next/Library/2018-05-05-18-02-24.bpo-20087.lJrvXL.rst b/Misc/NEWS.d/next/Library/2018-05-05-18-02-24.bpo-20087.lJrvXL.rst
new file mode 100644
index 000000000000..2342cb781926
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-05-05-18-02-24.bpo-20087.lJrvXL.rst
@@ -0,0 +1 @@
+Updated alias mapping with glibc 2.27 supported locales.
More information about the Python-checkins
mailing list