Skip to content

Babel fails to handle C locale properly #1236

Description

@ajeb78

The "C" locale is the only one that is guaranteed to be available on all systems, however Babel does not handle it correctly:

13:12:25:   File "/home/xxxx/venv/lib/python3.12/site-packages/babel/core.py", line 427, in parse
13:12:25:     raise UnknownLocaleError(input_id)
13:12:25: babel.core.UnknownLocaleError: unknown locale 'c'

This is problematic if a python program that uses Babel is running with the C locale set.

Activity

  1. akx commented on Nov 5, 2025

    @akx
    Member

    Could you show a little more of the traceback?

    In particular, is this program passing in an explicit locale, or is it trying to use Babel's default locale (which could indeed have been read to be C from the environment)?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions