Skip to content

python -m locale fails on OSX #54299

Closed
Closed

Description

@abalkin
BPO 10090
Nosy @malemburg, @loewis, @ronaldoussoren, @abalkin, @merwok
Dependencies
  • bpo-10154: locale.normalize strips "-" from UTF-8, which fails on Mac
  • 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 = <Date 2011-05-17.12:15:25.397>
    created_at = <Date 2010-10-13.19:33:11.525>
    labels = ['type-bug', 'library']
    title = 'python -m locale fails on OSX'
    updated_at = <Date 2011-05-17.12:15:25.396>
    user = 'https://github.com/abalkin'

    bugs.python.org fields:

    activity = <Date 2011-05-17.12:15:25.396>
    actor = 'ronaldoussoren'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-05-17.12:15:25.397>
    closer = 'ronaldoussoren'
    components = ['Library (Lib)']
    creation = <Date 2010-10-13.19:33:11.525>
    creator = 'belopolsky'
    dependencies = ['10154']
    files = []
    hgrepos = []
    issue_num = 10090
    keywords = []
    message_count = 2.0
    messages = ['118567', '136151']
    nosy_count = 5.0
    nosy_names = ['lemburg', 'loewis', 'ronaldoussoren', 'belopolsky', 'eric.araujo']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue10090'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    Activity

    1. abalkin commented on Oct 13, 2010

      @abalkin
      MemberAuthor
      $ python -m locale
      Locale aliasing:

      Locale defaults as determined by getdefaultlocale():
      ------------------------------------------------------------------------
      Language: en_US
      Encoding: UTF8
      ..

      Locale settings after calling resetlocale():
      ------------------------------------------------------------------------

      Traceback (most recent call last):
       ..

      File "Lib/locale.py", line 548, in resetlocale
      _setlocale(category, _build_localename(getdefaultlocale()))
      locale.Error: unsupported locale setting

      Apparently the problem is due to locale.getdefaultlocale() returning encoding as 'UTF8' while locale.setlocale() expects 'UTF-8'.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Oct 13, 2010
    3. ronaldoussoren commented on May 17, 2011

      @ronaldoussoren
      Contributor

      I've applied a fix for bpo-10154 and that also fixes this problem.

    4. transferred this issue fromon Apr 10, 2022
    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

      stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions