diff options
Diffstat (limited to 'gnu/packages/patches/python-libxml2-utf8.patch')
| -rw-r--r-- | gnu/packages/patches/python-libxml2-utf8.patch | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gnu/packages/patches/python-libxml2-utf8.patch b/gnu/packages/patches/python-libxml2-utf8.patch index e39672faa1b..9c4ca4fdb29 100644 --- a/gnu/packages/patches/python-libxml2-utf8.patch +++ b/gnu/packages/patches/python-libxml2-utf8.patch | |||
| @@ -6,18 +6,18 @@ that 'itstool' stumbles upon when processing UTF-8 data: | |||
| 6 | Patch by Jan Matejek | 6 | Patch by Jan Matejek |
| 7 | from <https://bugzilla.opensuse.org/show_bug.cgi?id=1065270>. | 7 | from <https://bugzilla.opensuse.org/show_bug.cgi?id=1065270>. |
| 8 | 8 | ||
| 9 | --- libxml2-2.9.5.orig/python/libxml.c | 9 | --- a/python/libxml.c |
| 10 | +++ libxml2-2.9.5/python/libxml.c | 10 | +++ b/python/libxml.c |
| 11 | @@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU | 11 | @@ -1499,6 +1499,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg, |
| 12 | PyObject *message; | 12 | PyObject *message; |
| 13 | PyObject *result; | 13 | PyObject *result; |
| 14 | char str[1000]; | 14 | char str[1000]; |
| 15 | + unsigned char *ptr = (unsigned char *)str; | 15 | + unsigned char *ptr = (unsigned char *)str; |
| 16 | 16 | ||
| 17 | #ifdef DEBUG_ERROR | 17 | if (libxml_xmlPythonErrorFuncHandler == NULL) { |
| 18 | printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg); | 18 | va_start(ap, msg); |
| 19 | @@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU | 19 | @@ -1510,12 +1511,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg, |
| 20 | str[999] = 0; | 20 | str[999] = 0; |
| 21 | va_end(ap); | 21 | va_end(ap); |
| 22 | 22 | ||
| 23 | +#if PY_MAJOR_VERSION >= 3 | 23 | +#if PY_MAJOR_VERSION >= 3 |
| @@ -32,7 +32,7 @@ from <https://bugzilla.opensuse.org/show_bug.cgi?id=1065270>. | |||
| 32 | - message = libxml_charPtrConstWrap(str); | 32 | - message = libxml_charPtrConstWrap(str); |
| 33 | + message = libxml_charPtrConstWrap(ptr); | 33 | + message = libxml_charPtrConstWrap(ptr); |
| 34 | PyTuple_SetItem(list, 1, message); | 34 | PyTuple_SetItem(list, 1, message); |
| 35 | result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list); | 35 | result = PyObject_CallObject(libxml_xmlPythonErrorFuncHandler, list); |
| 36 | + /* Forget any errors caused in the error handler. */ | 36 | + /* Forget any errors caused in the error handler. */ |
| 37 | + PyErr_Clear(); | 37 | + PyErr_Clear(); |
| 38 | Py_XDECREF(list); | 38 | Py_XDECREF(list); |
