babel icon indicating copy to clipboard operation
babel copied to clipboard

Babel fails to handle C locale properly

Open ajeb78 opened this issue 2 months ago • 1 comments

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.

ajeb78 avatar Nov 05 '25 10:11 ajeb78

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)?

akx avatar Nov 05 '25 11:11 akx