Skip to content

Commit 4dc4c88

Browse files
committed
Correct invalid universal locale names
These probably don't matter for anything. According to the comments in locale.alias, univ and universal apply to HPUX 9.x. But the "en_US.utf" values are obviously incorrect, and invalid in glibc. Debian has been carrying this patch since around Python 2.4. Either it should be upstream, or it should be dropped from Debian. Looking into this leads to bpo-20087, which temporarily fixed this before, as part of a larger cleanup in the migration to glibc 2.24 locales. That was reverted. The invalid value itself comes from xfree86, as far as I can tell. It appeared in 1999 [0] and were corrected in 2000 [1]. locale.py was written in-between and cribbed the broken values [2]. [0]: https://gitlab.freedesktop.org/ajax/xfree86/-/commit/16664e079de9938a4354e94c5c5afe5476bbaa98#8c0c2f24be5c75f99e8d6e55aa310736636d2584_10_480 [1]: https://gitlab.freedesktop.org/ajax/xfree86/-/commit/40f478e907f33fc56633bb16f7a6756314d0c10d?page=3#8c0c2f24be5c75f99e8d6e55aa310736636d2584_496_496 [2]: 5431bc3
1 parent 0fd97e4 commit 4dc4c88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/locale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,8 +1407,8 @@ def getpreferredencoding(do_setlocale=True):
14071407
'ug_cn': 'ug_CN.UTF-8',
14081408
'uk': 'uk_UA.KOI8-U',
14091409
'uk_ua': 'uk_UA.KOI8-U',
1410-
'univ': 'en_US.utf',
1411-
'universal': 'en_US.utf',
1410+
'univ': 'en_US.UTF-8',
1411+
'universal': 'en_US.UTF-8',
14121412
'universal.utf8@ucs4': 'en_US.UTF-8',
14131413
'unm_us': 'unm_US.UTF-8',
14141414
'ur': 'ur_PK.CP1256',

0 commit comments

Comments
 (0)