Skip to content

locale: setlocale(..., 'eo') sets non-existing locale #79344

Closed as not planned
Closed as not planned

Description

@carmenbianca
BPO 35163
Nosy @malemburg, @carmenbianca
PRs
  • bpo-35163: Change locale_alias for Esperanto #17901
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2018-11-04.15:54:37.498>
    labels = ['3.7', 'library']
    title = "locale: setlocale(..., 'eo') sets non-existing locale"
    updated_at = <Date 2020-01-08.01:52:07.078>
    user = 'https://github.com/carmenbianca'

    bugs.python.org fields:

    activity = <Date 2020-01-08.01:52:07.078>
    actor = 'carmenbianca'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2018-11-04.15:54:37.498>
    creator = 'carmenbianca'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35163
    keywords = ['patch']
    message_count = 1.0
    messages = ['329235']
    nosy_count = 2.0
    nosy_names = ['lemburg', 'carmenbianca']
    pr_nums = ['17901']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue35163'
    versions = ['Python 3.7']

    Activity

    1. carmenbianca commented on Nov 4, 2018

      carmenbiancamannequin
      MannequinAuthor

      See the following script:

      >>> import locale
      >>> locale.setlocale(locale.LC_ALL, 'eo')
      '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/locale.py", 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, locale.py 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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 4, 2018
    3. transferred this issue fromon Apr 10, 2022
    4. arhadthedev commented on Feb 13, 2023

      @arhadthedev
      Member

      Esperanto locales were indeed fixed in gh-422 but then reverted in gh-713. According to gh-64286, this is because CPython uses X11 names from locale.alias instead of GLibc aliases and both alternatives lead to bugs.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions