mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Patch #102940: use only printable Unicode chars in reporting
incorrect % characters; characters outside the printable range are replaced with '?'
This commit is contained in:
parent
7ff3133a7f
commit
f947ffe951
1 changed files with 2 additions and 1 deletions
|
@ -5069,7 +5069,8 @@ PyObject *PyUnicode_Format(PyObject *format,
|
||||||
PyErr_Format(PyExc_ValueError,
|
PyErr_Format(PyExc_ValueError,
|
||||||
"unsupported format character '%c' (0x%x) "
|
"unsupported format character '%c' (0x%x) "
|
||||||
"at index %i",
|
"at index %i",
|
||||||
c, c, fmt -1 - PyUnicode_AS_UNICODE(uformat));
|
(31<=c && c<=126) ? c : '?',
|
||||||
|
c, fmt -1 - PyUnicode_AS_UNICODE(uformat));
|
||||||
goto onError;
|
goto onError;
|
||||||
}
|
}
|
||||||
if (sign) {
|
if (sign) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue