From b52ea727c746477458adfe656284f9d15a648185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 6 Jan 2025 16:21:46 +0100 Subject: [PATCH] Fix build with Python 3.14 - Fixes: rhbz#2335830 --- 9e95960cd6.patch | 41 +++++++++++++++++++++++++++++++++++++++++ python-lxml.spec | 5 +++++ 2 files changed, 46 insertions(+) create mode 100644 9e95960cd6.patch diff --git a/9e95960cd6.patch b/9e95960cd6.patch new file mode 100644 index 0000000..9ae7533 --- /dev/null +++ b/9e95960cd6.patch @@ -0,0 +1,41 @@ +From 9e95960cd69a3e0393f4266d60a6f5a2a755de0d Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Fri, 25 Oct 2024 15:50:04 +0200 +Subject: [PATCH] Fix missing "//" in file URLs under Py3.14. Closes + https://bugs.launchpad.net/bugs/2085619 + +--- + src/lxml/tests/common_imports.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/lxml/tests/common_imports.py b/src/lxml/tests/common_imports.py +index 2d371852c..83c3a909a 100644 +--- a/src/lxml/tests/common_imports.py ++++ b/src/lxml/tests/common_imports.py +@@ -103,7 +103,7 @@ def tearDown(self): + def parse(self, text, parser=None): + f = BytesIO(text) if isinstance(text, bytes) else StringIO(text) + return etree.parse(f, parser=parser) +- ++ + def _rootstring(self, tree): + return etree.tostring(tree.getroot()).replace( + b' ', b'').replace(b'\n', b'') +@@ -118,7 +118,7 @@ def assertRegex(self, *args, **kwargs): + class SillyFileLike: + def __init__(self, xml_data=b''): + self.xml_data = xml_data +- ++ + def read(self, amount=None): + if self.xml_data: + if amount: +@@ -202,7 +202,7 @@ def fileInTestDir(name): + + def path2url(path): + return urlparse.urljoin( +- 'file:', pathname2url(path)) ++ 'file://', pathname2url(path)) + + + def fileUrlInTestDir(name): diff --git a/python-lxml.spec b/python-lxml.spec index 343146f..c529f8f 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -16,6 +16,11 @@ URL: https://github.com/lxml/lxml Source0: lxml-%{version}-no-isoschematron-rng.tar.gz Source1: get-lxml-source.sh +# Fix missing "//" in file URLs under Python 3.14 +# https://bugs.launchpad.net/bugs/2085619 +# https://bugzilla.redhat.com/2335830 +Patch: https://github.com/lxml/lxml/commit/9e95960cd6.patch + BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: libxslt-devel