You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "<eval command - snippet #20>", line 4, in func
print(format_list([1, 2, 3, 4], style="unit", locale="zh_CN"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/redenv/lib/python3.11/site-packages/babel/lists.py", line 89, in format_list
result = patterns['start'].format(lst[0], lst[1])
~~~~~~~~^^^^^^^^^
File "/home/ubuntu/redenv/lib/python3.11/site-packages/babel/localedata.py", line 234, in __getitem__
orig = val = self._data[key]
~~~~~~~~~~^^^^^
KeyError: 'start'
Expected Results
Something like 1, 2, 3, 4 but locale dependent of course!
Reproducibility
I can reproduce this in every non-Engilsh language I've tried, es_ES zh_CN fr_FR
Various EN locales en_GB en_US en_CN produce the expected result 1, 2, 3, 4
Additional Information
Similar to #781 but this error occurs with supported styleunit and has a wider language scope
The text was updated successfully, but these errors were encountered:
Overview Description
babel.lists.format_list does not work with non-English locales, when style is set to "unit".
Steps to Reproduce
Install latest babel 2.15.0
Actual Results
Expected Results
Something like
1, 2, 3, 4
but locale dependent of course!Reproducibility
I can reproduce this in every non-Engilsh language I've tried, es_ES zh_CN fr_FR
Various EN locales en_GB en_US en_CN produce the expected result
1, 2, 3, 4
Additional Information
Similar to #781 but this error occurs with supported style
unit
and has a wider language scopeThe text was updated successfully, but these errors were encountered: