public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "David Seifert" <soap@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
Date: Tue, 29 Nov 2022 19:59:05 +0000 (UTC)	[thread overview]
Message-ID: <1669751924.bee4fbd32b0225d09bf7fca8d38b83a9ac368bfd.soap@gentoo> (raw)

commit:     bee4fbd32b0225d09bf7fca8d38b83a9ac368bfd
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 19:58:44 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Nov 29 19:58:44 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bee4fbd3

dev-libs/libxml2: add workaround patch for itstool breakage

Bug: https://bugs.gentoo.org/745162
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../libxml2-2.10.3-python3-unicode-errors.patch    | 35 ++++++++++++++++++++++
 ...xml2-2.10.3.ebuild => libxml2-2.10.3-r1.ebuild} |  2 ++
 2 files changed, 37 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch b/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch
new file mode 100644
index 000000000000..525e1fe36c0b
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/745162
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
+
+--- a/python/libxml.c
++++ b/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.10.3.ebuild b/dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
similarity index 98%
rename from dev-libs/libxml2/libxml2-2.10.3.ebuild
rename to dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
index 7b940b3948b0..bc2c968b0da6 100644
--- a/dev-libs/libxml2/libxml2-2.10.3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
@@ -56,6 +56,8 @@ MULTILIB_CHOST_TOOLS=(
 	/usr/bin/xml2-config
 )
 
+PATCHES=( "${FILESDIR}"/${PN}-2.10.3-python3-unicode-errors.patch )
+
 DOCS=( NEWS README.md TODO TODO_SCHEMAS python/TODO )
 
 src_unpack() {


             reply	other threads:[~2022-11-29 19:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 19:59 David Seifert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-05-10 22:01 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/ Sam James
2021-10-29 13:46 David Seifert
2021-05-20  1:46 Sam James
2021-05-13 17:50 Sam James
2020-12-03  0:14 Sam James
2020-10-30 22:39 Matt Turner
2020-10-30 22:34 Matt Turner
2020-01-01 16:28 Mart Raudsepp
2019-03-30 20:57 Mart Raudsepp
2019-01-03 11:22 Mike Frysinger
2019-01-03 11:22 Mike Frysinger
2019-01-03 11:22 Mike Frysinger
2018-07-25 16:47 Mart Raudsepp
2015-11-29 11:58 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1669751924.bee4fbd32b0225d09bf7fca8d38b83a9ac368bfd.soap@gentoo \
    --to=soap@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox