diff --git a/libxml2-python3-unicode-errors.patch b/libxml2-python3-unicode-errors.patch index baf45e3..74d955f 100644 --- a/libxml2-python3-unicode-errors.patch +++ b/libxml2-python3-unicode-errors.patch @@ -1,12 +1,8 @@ ---- - python/libxml.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -Index: libxml2-2.11.1/python/libxml.c +Index: libxml2-2.9.5/python/libxml.c =================================================================== ---- libxml2-2.11.1.orig/python/libxml.c -+++ libxml2-2.11.1/python/libxml.c -@@ -1606,6 +1606,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU +--- libxml2-2.9.5.orig/python/libxml.c ++++ libxml2-2.9.5/python/libxml.c +@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU PyObject *message; PyObject *result; char str[1000]; @@ -14,7 +10,7 @@ Index: libxml2-2.11.1/python/libxml.c #ifdef DEBUG_ERROR printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg); -@@ -1622,12 +1623,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU +@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU str[999] = 0; va_end(ap); @@ -30,7 +26,7 @@ Index: libxml2-2.11.1/python/libxml.c - message = libxml_charPtrConstWrap(str); + message = libxml_charPtrConstWrap(ptr); PyTuple_SetItem(list, 1, message); - result = PyObject_CallObject(libxml_xmlPythonErrorFuncHandler, list); + result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list); + /* Forget any errors caused in the error handler. */ + PyErr_Clear(); Py_XDECREF(list); diff --git a/python-libxml2-python.changes b/python-libxml2-python.changes index 5d73fc4..305a672 100644 --- a/python-libxml2-python.changes +++ b/python-libxml2-python.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 26 14:10:55 UTC 2017 - jmatejek@suse.com + +- libxml2-python3-unicode-errors.patch: work around an issue with + libxml2 supplied error strings being undecodable UTF-8 (bsc#1065270) + ------------------------------------------------------------------- Mon Oct 2 15:59:57 UTC 2017 - jmatejek@suse.com diff --git a/python-libxml2-python.spec b/python-libxml2-python.spec index 13c25a6..59be9a6 100644 --- a/python-libxml2-python.spec +++ b/python-libxml2-python.spec @@ -27,6 +27,7 @@ Group: Development/Libraries/Python Url: http://xmlsoft.org Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz Patch0: python3.6-verify_fd.patch +Patch1: libxml2-python3-unicode-errors.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module xml} BuildRequires: pkgconfig @@ -55,6 +56,7 @@ either at parse time or later once the document has been modified. %prep %setup -q -n libxml2-%{version} %patch0 -p1 +%patch1 -p1 %build export CFLAGS="%{optflags} -fno-strict-aliasing"