From 9e8166843c223dbb9813462b95d39995702d4e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Wed, 2 Nov 2011 12:45:42 +0100 Subject: Introduce PyObject* API for raising encode errors. --- Objects/unicodeobject.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7147f04..0a33ece 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -257,6 +257,12 @@ raise_encode_exception(PyObject **exceptionObject, const Py_UNICODE *unicode, Py_ssize_t size, Py_ssize_t startpos, Py_ssize_t endpos, const char *reason); +static void +raise_encode_exception_obj(PyObject **exceptionObject, + const char *encoding, + PyObject *unicode, + Py_ssize_t startpos, Py_ssize_t endpos, + const char *reason); /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { @@ -4786,9 +4792,9 @@ _PyUnicode_AsUTF8String(PyObject *obj, const char *errors) for(k=0; k