mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
OverflowError when an argument of %c format is out of range.
This commit is contained in:
commit
c89533f72f
3 changed files with 6 additions and 1 deletions
|
@ -2496,7 +2496,7 @@ unicode_fromformat_arg(_PyUnicodeWriter *writer,
|
|||
{
|
||||
int ordinal = va_arg(*vargs, int);
|
||||
if (ordinal < 0 || ordinal > MAX_UNICODE) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"character argument not in range(0x110000)");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue