Hello community,

here is the log from the commit of package libxml2 for openSUSE:Factory checked 
in at 2017-11-03 16:31:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libxml2 (Old)
 and      /work/SRC/openSUSE:Factory/.libxml2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libxml2"

Fri Nov  3 16:31:32 2017 rev:89 rq:536925 version:2.9.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/libxml2/python-libxml2-python.changes    
2017-10-05 11:54:47.130364991 +0200
+++ /work/SRC/openSUSE:Factory/.libxml2.new/python-libxml2-python.changes       
2017-11-03 16:31:47.069067677 +0100
@@ -1,0 +2,6 @@
+Thu Oct 26 14:10:55 UTC 2017 - [email protected]
+
+- libxml2-python3-unicode-errors.patch: work around an issue with
+  libxml2 supplied error strings being undecodable UTF-8 (bsc#1065270)
+
+-------------------------------------------------------------------

New:
----
  libxml2-python3-unicode-errors.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-libxml2-python.spec ++++++
--- /var/tmp/diff_new_pack.Xongfg/_old  2017-11-03 16:31:47.825040162 +0100
+++ /var/tmp/diff_new_pack.Xongfg/_new  2017-11-03 16:31:47.825040162 +0100
@@ -27,6 +27,7 @@
 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 @@
 %prep
 %setup -q -n libxml2-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 export CFLAGS="%{optflags} -fno-strict-aliasing"


++++++ libxml2-python3-unicode-errors.patch ++++++
Index: libxml2-2.9.5/python/libxml.c
===================================================================
--- 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];
+    unsigned char *ptr = (unsigned char *)str;
 
 #ifdef DEBUG_ERROR
     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
            str[999] = 0;
         va_end(ap);
 
+#if PY_MAJOR_VERSION >= 3
+        /* Ensure the error string doesn't start at UTF8 continuation. */
+        while (*ptr && (*ptr & 0xc0) == 0x80)
+            ptr++;
+#endif
+
         list = PyTuple_New(2);
         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
-        message = libxml_charPtrConstWrap(str);
+        message = libxml_charPtrConstWrap(ptr);
         PyTuple_SetItem(list, 1, message);
         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+        /* Forget any errors caused in the error handler. */
+        PyErr_Clear();
         Py_XDECREF(list);
         Py_XDECREF(result);
     }

Reply via email to