[issue31900] localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding

STINNER Victor report at bugs.python.org
Wed Jan 10 11:59:11 EST 2018


STINNER Victor <victor.stinner at gmail.com> added the comment:

I completed my change. It now fixes locale.localeconv(), str.format() for int, float, complex and decimal.Decimal:

vstinner at apu$ ./python lc_numeric.py 
LC_CTYPE: ('fr_FR', 'ISO8859-1')
LC_NUMERIC: ('es_MX', 'UTF-8')
decimal_point: '.'
thousands_sep: '\u2009'
grouping: [3, 3, 0]
int.__format__: '1\u2009234'
float.__format__: '1\u2009234'
complex.__format__: '1\u2009234+0j'
Decimal.__format__: '1\u2009234'

----------
Added file: https://bugs.python.org/file47377/lc_numeric.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31900>
_______________________________________


More information about the Python-bugs-list mailing list