mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174)
* Add _Py_GetLocaleconvNumeric() function: decode decimal_point and thousands_sep fields of localeconv() from the LC_NUMERIC encoding, rather than decoding from the LC_CTYPE encoding. * Modify locale.localeconv() and "n" formatter of str.format() (for int, float and complex to use _Py_GetLocaleconvNumeric() internally.
This commit is contained in:
parent
7ed7aead95
commit
cb064fc232
8 changed files with 151 additions and 19 deletions
|
@ -160,6 +160,11 @@ PyAPI_FUNC(int) _Py_get_blocking(int fd);
|
|||
PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking);
|
||||
#endif /* !MS_WINDOWS */
|
||||
|
||||
PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
|
||||
PyObject **decimal_point,
|
||||
PyObject **thousands_sep,
|
||||
const char **grouping);
|
||||
|
||||
#endif /* Py_LIMITED_API */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue