Title: locale: setlocale(..., 'eo') sets non-existing locale
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: carmenbianca, lemburg
Priority: normal Keywords: patch

Created on 2018-11-04 15:54 by carmenbianca, last changed 2020-01-08 01:52 by carmenbianca.

Pull Requests
URL Status Linked Edit
PR 17901 open carmenbianca, 2020-01-08 01:52
Messages (1)
msg329235 - (view) Author: Carmen Bianca Bakker (carmenbianca) * Date: 2018-11-04 15:54
See the following script:

>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'eo')
>>> my_locale = locale.getlocale()
>>> my_locale
('eo_XX', 'ISO8859-3')
>>> locale.setlocale(locale.LC_ALL, my_locale)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.7/", line 604, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

'eo_XX.ISO8859-3' does not exist on Fedora 29 or Debian Stretch. The only Esperanto locales that exists are 'eo' and 'eo.utf8'.  Even so, defines the Esperanto locales as follows:

    'eo':                                   'eo_XX.ISO8859-3',
    'eo.utf8':                              'eo.UTF-8',
    'eo_eo':                                'eo_EO.ISO8859-3',
    'eo_us.utf8':                           'eo_US.UTF-8',
    'eo_xx':                                'eo_XX.ISO8859-3',

eo_EO used to exist on Debian in the early 2000s, and eo_XX on some other distributions.  Since glibc 2.24 upstreamed Esperanto, however, it has been 'eo[.utf8]'.

I'm not sure whether 'eo_eo', 'eo_us' and/or 'eo_xx' should be removed as keys, but 'eo' should have 'eo.UTF-8' as value.
Date User Action Args
2020-01-08 01:52:07carmenbiancasetkeywords: + patch
stage: patch review
pull_requests: + pull_request17313
2018-11-04 19:07:07serhiy.storchakasetnosy: + lemburg
2018-11-04 15:54:37carmenbiancacreate