Commit f947ffe9 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Patch #102940: use only printable Unicode chars in reporting

 incorrect % characters; characters outside the printable range are
 replaced with '?'
parent 7ff3133a
......@@ -5069,7 +5069,8 @@ PyObject *PyUnicode_Format(PyObject *format,
PyErr_Format(PyExc_ValueError,
"unsupported format character '%c' (0x%x) "
"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;
}
if (sign) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment