mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Close #17694: Add minimum length to _PyUnicodeWriter
* Add also min_char attribute to _PyUnicodeWriter structure (currently unused) * _PyUnicodeWriter_Init() has no more argument (except the writer itself): min_length and overallocate must be set explicitly * In error handlers, only enable overallocation if the replacement string is longer than 1 character * CJK decoders don't use overallocation anymore * Set min_length, instead of preallocating memory using _PyUnicodeWriter_Prepare(), in many decoders * _PyUnicode_DecodeUnicodeInternal() checks for integer overflow
This commit is contained in:
parent
e84a51c38e
commit
8f674ccd64
7 changed files with 81 additions and 71 deletions
|
@ -1711,7 +1711,7 @@ float__format__(PyObject *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
|
||||
return NULL;
|
||||
|
||||
_PyUnicodeWriter_Init(&writer, 0);
|
||||
_PyUnicodeWriter_Init(&writer);
|
||||
ret = _PyFloat_FormatAdvancedWriter(
|
||||
&writer,
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue