diff options
author | Sam James <sam@gentoo.org> | 2020-12-03 00:13:24 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2020-12-03 00:14:49 +0000 |
commit | da4038c33b2c7684f5766d6e8f1d1089e863e87c (patch) | |
tree | 0ce3ca3f1046501d835a27ecbb0d812ab9827a11 /dev-libs/libxml2 | |
parent | dev-lua/luaposix: migrate to lua.eclass (diff) | |
download | gentoo-da4038c33b2c7684f5766d6e8f1d1089e863e87c.tar.gz gentoo-da4038c33b2c7684f5766d6e8f1d1089e863e87c.tar.bz2 gentoo-da4038c33b2c7684f5766d6e8f1d1089e863e87c.zip |
dev-libs/libxml2: restore itstool-segfault patch
We stopped applying this patch during a roll
of a new patchset (my fault), but it seems to still
be needed. Noticed when building some of MATE.
Bug: https://bugs.gentoo.org/745162
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/libxml2')
-rw-r--r-- | dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch | 34 | ||||
-rw-r--r-- | dev-libs/libxml2/libxml2-2.9.10-r4.ebuild (renamed from dev-libs/libxml2/libxml2-2.9.10-r3.ebuild) | 3 |
2 files changed, 37 insertions, 0 deletions
diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch new file mode 100644 index 000000000000..e87dcdedf88c --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch @@ -0,0 +1,34 @@ +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); + } diff --git a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild b/dev-libs/libxml2/libxml2-2.9.10-r4.ebuild index 916abdd469c6..a6678320ffe2 100644 --- a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild +++ b/dev-libs/libxml2/libxml2-2.9.10-r4.ebuild @@ -93,6 +93,9 @@ src_prepare() { # Fix python tests when building out of tree #565576 eapply "${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch + # bug #745162 + eapply "${FILESDIR}"/${PN}-2.9.8-python3-unicode-errors.patch + if [[ ${CHOST} == *-darwin* ]] ; then # Avoid final linking arguments for python modules sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die |