Fix test_wrap_html with Python 3.14rc1

This commit is contained in:
Lumir Balhar 2025-08-05 09:59:19 +02:00
commit d4c3d0bb6c
2 changed files with 27 additions and 0 deletions

23
473.patch Normal file
View file

@ -0,0 +1,23 @@
From ba44171d105f291568e239970c152e800cf8a3b7 Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
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):
# <head> outside <html>, parser should fix that
- html = '<head><title>title</test></head><html><body/></html>'
+ html = '<head><title>title</title></head><html><body/></html>'
res = b'<html><head><title>title</title></head><body></body></html>'
tree = self.soupparser.fromstring(html)
self.assertEqual(tostring(tree), res)

View file

@ -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