From d4c3d0bb6c455c6d8ca09d225a25436ab8b289be Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 5 Aug 2025 09:59:19 +0200 Subject: [PATCH] Fix test_wrap_html with Python 3.14rc1 --- 473.patch | 23 +++++++++++++++++++++++ python-lxml.spec | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 473.patch diff --git a/473.patch b/473.patch new file mode 100644 index 0000000..30cfa21 --- /dev/null +++ b/473.patch @@ -0,0 +1,23 @@ +From ba44171d105f291568e239970c152e800cf8a3b7 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Tue, 5 Aug 2025 12:15:03 +0200 +Subject: [PATCH] Fix `test_wrap_html` with the latest Python HTMLParser + +Fixes: https://bugs.launchpad.net/lxml/+bug/2119510 +--- + src/lxml/html/tests/test_elementsoup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lxml/html/tests/test_elementsoup.py b/src/lxml/html/tests/test_elementsoup.py +index 94d21636b..7e4aa899b 100644 +--- a/src/lxml/html/tests/test_elementsoup.py ++++ b/src/lxml/html/tests/test_elementsoup.py +@@ -50,7 +50,7 @@ def test_head_body(self): + + def test_wrap_html(self): + # outside , parser should fix that +- html = 'title</test></head><html><body/></html>' ++ html = '<head><title>title' + res = b'title' + tree = self.soupparser.fromstring(html) + self.assertEqual(tostring(tree), res) diff --git a/python-lxml.spec b/python-lxml.spec index 2b5f320..1a8b71e 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -16,6 +16,10 @@ URL: https://github.com/lxml/lxml Source0: lxml-%{version}-no-isoschematron-rng.tar.gz Source1: get-lxml-source.sh +# Fix for test_wrap_html +# https://bugs.launchpad.net/lxml/+bug/2119510 +Patch: https://github.com/lxml/lxml/pull/473.patch + BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: libxslt-devel