Message380104
test_format:test_locale tests for the existence of the thousands separator in a formatted number.
However, my locale does not expect/enforce (not sure what the correct term is) grouping the number in thousands, which leads to the test (and consequently the whole test suite) failing:
➜ cpython git:(test-format-locale-fix) ./python
Python 3.10.0a1+ (heads/master:3bf0d02f28, Oct 31 2020, 22:42:09)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, '')
'LC_CTYPE=en_US.UTF-8;LC_NUMERIC=el_GR.UTF-8;LC_TIME=el_GR.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=el_GR.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=el_GR.UTF-8;LC_NAME=el_GR.UTF-8;LC_ADDRESS=el_GR.UTF-8;LC_TELEPHONE=el_GR.UTF-8;LC_MEASUREMENT=el_GR.UTF-8;LC_IDENTIFICATION=el_GR.UTF-8'
>>> format(123456789, 'n')
'123456789'
>>> locale.localeconv()['grouping']
[]
I guess the fix here is to check whether grouping is empty or not in test_locale. |
|
Date |
User |
Action |
Args |
2020-10-31 22:39:36 | lys.nikolaou | set | recipients:
+ lys.nikolaou |
2020-10-31 22:39:36 | lys.nikolaou | set | messageid: <1604183976.7.0.233218767398.issue42224@roundup.psfhosted.org> |
2020-10-31 22:39:36 | lys.nikolaou | link | issue42224 messages |
2020-10-31 22:39:36 | lys.nikolaou | create | |
|