cpython: 58cd562e3ef9 (original) (raw)
--- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1372,9 +1372,8 @@ PyUnicode_CopyCharacters(PyObject *to, P how_many = Py_MIN(PyUnicode_GET_LENGTH(from), how_many); if (to_start + how_many > PyUnicode_GET_LENGTH(to)) { PyErr_Format(PyExc_SystemError,
"Cannot write %" PY_FORMAT_SIZE_T "i characters at %"[](#l1.7)
PY_FORMAT_SIZE_T "i in a string of %"[](#l1.8)
PY_FORMAT_SIZE_T "i characters",[](#l1.9)
"Cannot write %zi characters at %zi "[](#l1.10)
} @@ -4083,9 +4082,7 @@ unicode_decode_call_errorhandler_wchar( if (newpos<0) newpos = insize+newpos; if (newpos<0 || newpos>insize) {"in a string of %zi characters",[](#l1.11) how_many, to_start, PyUnicode_GET_LENGTH(to));[](#l1.12) return -1;[](#l1.13)
PyErr_Format(PyExc_IndexError,[](#l1.19)
"position %" PY_FORMAT_SIZE_T[](#l1.20)
"d from error handler out of bounds", newpos);[](#l1.21)
} @@ -4178,9 +4175,7 @@ unicode_decode_call_errorhandler_writer( if (newpos<0) newpos = insize+newpos; if (newpos<0 || newpos>insize) {PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos);[](#l1.22) goto onError;[](#l1.23)
PyErr_Format(PyExc_IndexError,[](#l1.30)
"position %" PY_FORMAT_SIZE_T[](#l1.31)
"d from error handler out of bounds", newpos);[](#l1.32)
} @@ -6443,9 +6438,7 @@ unicode_encode_call_errorhandler(const c if (*newpos<0) *newpos = len + *newpos; if (*newpos<0 || *newpos>len) {PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", newpos);[](#l1.33) goto onError;[](#l1.34)
PyErr_Format(PyExc_IndexError,[](#l1.41)
"position %" PY_FORMAT_SIZE_T[](#l1.42)
"d from error handler out of bounds", *newpos);[](#l1.43)
} @@ -8445,9 +8438,7 @@ unicode_translate_call_errorhandler(cons else *newpos = i_newpos; if (*newpos<0 || *newpos>PyUnicode_GET_LENGTH(unicode)) {PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos);[](#l1.44) Py_DECREF(restuple);[](#l1.45) return NULL;[](#l1.46)
PyErr_Format(PyExc_IndexError,[](#l1.52)
"position %" PY_FORMAT_SIZE_T[](#l1.53)
"d from error handler out of bounds", *newpos);[](#l1.54)
} @@ -9775,8 +9766,7 @@ PyUnicode_Join(PyObject *separator, PyOb item = items[i]; if (!PyUnicode_Check(item)) { PyErr_Format(PyExc_TypeError,PyErr_Format(PyExc_IndexError, "position %zd from error handler out of bounds", *newpos);[](#l1.55) Py_DECREF(restuple);[](#l1.56) return NULL;[](#l1.57)
"sequence item %" PY_FORMAT_SIZE_T[](#l1.63)
"d: expected str instance,"[](#l1.64)
"sequence item %zd: expected str instance,"[](#l1.65) " %.80s found",[](#l1.66) i, Py_TYPE(item)->tp_name);[](#l1.67) goto onError;[](#l1.68)
@@ -14466,7 +14456,7 @@ unicode_format_arg_format(struct unicode default: PyErr_Format(PyExc_ValueError, "unsupported format character '%c' (0x%x) "
"at index %" PY_FORMAT_SIZE_T "d",[](#l1.73)
"at index %zd",[](#l1.74) (31<=arg->ch && arg->ch<=126) ? (char)arg->ch : '?',[](#l1.75) (int)arg->ch,[](#l1.76) ctx->fmtpos - 1);[](#l1.77)