Lines Matching refs:errors

66 static char *incnewkwarglist[] = {"errors", NULL};
67 static char *streamkwarglist[] = {"stream", "errors", NULL};
101 internal_error_callback(const char *errors)
103 if (errors == NULL || strcmp(errors, "strict") == 0)
105 else if (strcmp(errors, "ignore") == 0)
107 else if (strcmp(errors, "replace") == 0)
110 return PyUnicode_FromString(errors);
114 call_error_callback(PyObject *errors, PyObject *exc)
119 assert(PyUnicode_Check(errors));
120 str = PyUnicode_AsUTF8(errors);
135 const char *errors;
137 if (self->errors == ERROR_STRICT)
138 errors = "strict";
139 else if (self->errors == ERROR_IGNORE)
140 errors = "ignore";
141 else if (self->errors == ERROR_REPLACE)
142 errors = "replace";
144 Py_INCREF(self->errors);
145 return self->errors;
148 return PyUnicode_FromString(errors);
163 PyErr_SetString(PyExc_TypeError, "errors must be a string");
175 ERROR_DECREF(self->errors);
176 self->errors = cb;
182 {"errors", (getter)codecctx_errors_get,
184 PyDoc_STR("how to treat errors")},
227 PyObject *errors, Py_ssize_t e)
258 if (errors == ERROR_REPLACE) {
293 if (errors == ERROR_IGNORE || errors == ERROR_REPLACE) {
316 if (errors == ERROR_STRICT) {
321 retobj = call_error_callback(errors, buf->excobj);
382 PyObject *errors, Py_ssize_t e)
414 if (errors == ERROR_REPLACE) {
419 if (errors == ERROR_IGNORE || errors == ERROR_REPLACE) {
442 if (errors == ERROR_STRICT) {
447 retobj = call_error_callback(errors, buf->excobj);
486 PyObject *errors, int flags)
531 else if (multibytecodec_encerror(codec, state, &buf, errors,r))
547 &buf, errors, r))
573 errors: str(accept={str, NoneType}) = None
577 'errors' may be given to set a different error handling scheme. Default is
578 'strict' meaning that encoding errors raise a UnicodeEncodeError. Other possible
586 const char *errors)
613 errorcb = internal_error_callback(errors);
642 errors: str(accept={str, NoneType}) = None
646 'errors' may be given to set a different error handling scheme. Default is
647 'strict' meaning that encoding errors raise a UnicodeDecodeError. Other possible
655 const char *errors)
667 errorcb = internal_error_callback(errors);
813 ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0);
890 buf, ctx->errors, r))
1035 char *errors = NULL;
1038 incnewkwarglist, &errors))
1057 self->errors = internal_error_callback(errors);
1058 if (self->errors == NULL)
1083 if (ERROR_ISCUSTOM(self->errors))
1084 Py_VISIT(self->errors);
1093 ERROR_DECREF(self->errors);
1172 &buf, self->errors, MBERR_TOOFEW)) {
1310 char *errors = NULL;
1313 incnewkwarglist, &errors))
1332 self->errors = internal_error_callback(errors);
1333 if (self->errors == NULL)
1358 if (ERROR_ISCUSTOM(self->errors))
1359 Py_VISIT(self->errors);
1368 ERROR_DECREF(self->errors);
1463 &buf, self->errors, MBERR_TOOFEW))
1627 char *errors = NULL;
1630 streamkwarglist, &stream, &errors))
1651 self->errors = internal_error_callback(errors);
1652 if (self->errors == NULL)
1677 if (ERROR_ISCUSTOM(self->errors))
1678 Py_VISIT(self->errors);
1688 ERROR_DECREF(self->errors);
1817 self->pending, NULL, self->errors,
1851 char *errors = NULL;
1854 streamkwarglist, &stream, &errors))
1875 self->errors = internal_error_callback(errors);
1876 if (self->errors == NULL)
1901 if (ERROR_ISCUSTOM(self->errors))
1902 Py_VISIT(self->errors);
1912 ERROR_DECREF(self->errors);