summaryrefslogtreecommitdiff
path: root/source/l
diff options
context:
space:
mode:
Diffstat (limited to 'source/l')
-rwxr-xr-xsource/l/libxml2/libxml2.SlackBuild3
-rw-r--r--source/l/libxml2/libxml2.python3-unicode-errors.patch34
-rwxr-xr-xsource/l/python-pycparser/python-pycparser.SlackBuild2
3 files changed, 37 insertions, 2 deletions
diff --git a/source/l/libxml2/libxml2.SlackBuild b/source/l/libxml2/libxml2.SlackBuild
index 85006e47..0968495a 100755
--- a/source/l/libxml2/libxml2.SlackBuild
+++ b/source/l/libxml2/libxml2.SlackBuild
@@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=libxml2
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -80,6 +80,7 @@ find . \
-exec chmod 644 {} \+
zcat $CWD/libxml2.do-not-check-crc.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/libxml2.python3-unicode-errors.patch.gz | patch -p1 --verbose || exit 1
# Fixes for python-3.9.x:
sed -i '/if Py/{s/Py/(Py/;s/)/))/}' python/{types.c,libxml.c}
diff --git a/source/l/libxml2/libxml2.python3-unicode-errors.patch b/source/l/libxml2/libxml2.python3-unicode-errors.patch
new file mode 100644
index 00000000..e87dcded
--- /dev/null
+++ b/source/l/libxml2/libxml2.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/source/l/python-pycparser/python-pycparser.SlackBuild b/source/l/python-pycparser/python-pycparser.SlackBuild
index 31ea8e42..cad99b5f 100755
--- a/source/l/python-pycparser/python-pycparser.SlackBuild
+++ b/source/l/python-pycparser/python-pycparser.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=python-pycparser
SRCNAM=pycparser
VERSION=${VERSION:-$(echo ${SRCNAM}-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-1}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in