mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623)
Fix str.format(), float.__format__() and complex.__format__() methods for non-ASCII decimal point when using the "n" formatter. Changes: * Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires a _PyUnicodeWriter object for the buffer and a Python str object for digits. * Rename FILL() macro to unicode_fill(), convert it to static inline function, add "assert(0 <= start);" and rework its code.
This commit is contained in:
parent
df108dc661
commit
59423e3ddd
5 changed files with 228 additions and 252 deletions
|
@ -2135,10 +2135,10 @@ PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
|
|||
see Objects/stringlib/localeutil.h */
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(
|
||||
PyObject *unicode,
|
||||
Py_ssize_t index,
|
||||
_PyUnicodeWriter *writer,
|
||||
Py_ssize_t n_buffer,
|
||||
void *digits,
|
||||
PyObject *digits,
|
||||
Py_ssize_t d_pos,
|
||||
Py_ssize_t n_digits,
|
||||
Py_ssize_t min_width,
|
||||
const char *grouping,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue