summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-26 12:40:01 (GMT)
committerGitHub <noreply@github.com>2018-11-26 12:40:01 (GMT)
commit59423e3ddd736387cef8f7632c71954c1859bed0 (patch)
treebf40d682a2c6bc0cf74f4850f7c8edefba9c34a8 /Include/unicodeobject.h
parentdf108dc6610e41c54ed064a854e3903c143f0d77 (diff)
downloadcpython-59423e3ddd736387cef8f7632c71954c1859bed0.zip
cpython-59423e3ddd736387cef8f7632c71954c1859bed0.tar.gz
cpython-59423e3ddd736387cef8f7632c71954c1859bed0.tar.bz2
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.
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index ffabf0e..e719285 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -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,