File CVE-2023-52425-libexpat-2.6.0-backport-15.6.patch of Package python314
---
Lib/test/test_pyexpat.py | 4 ++++
Lib/test/test_sax.py | 3 +++
Lib/test/test_xml_etree.py | 10 ++++++++++
3 files changed, 17 insertions(+)
Index: Python-3.14.0b4/Lib/test/test_pyexpat.py
===================================================================
--- Python-3.14.0b4.orig/Lib/test/test_pyexpat.py 2025-07-09 07:53:01.180304305 +0200
+++ Python-3.14.0b4/Lib/test/test_pyexpat.py 2025-07-09 07:55:44.221539903 +0200
@@ -791,6 +791,10 @@
self.assertEqual(started, ['doc'])
def test_reparse_deferral_disabled(self):
+ if expat.version_info < (2, 6, 0):
+ self.skipTest(f'Expat {expat.version_info} does not '
+ 'support reparse deferral')
+
started = []
def start_element(name, _):
Index: Python-3.14.0b4/Lib/test/test_sax.py
===================================================================
--- Python-3.14.0b4.orig/Lib/test/test_sax.py 2025-07-09 07:53:01.235965215 +0200
+++ Python-3.14.0b4/Lib/test/test_sax.py 2025-07-09 07:55:44.222266328 +0200
@@ -1241,6 +1241,9 @@
self.assertEqual(result.getvalue(), start + b"<doc></doc>")
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ f'Expat {pyexpat.version_info} does not '
+ 'support reparse deferral')
def test_flush_reparse_deferral_disabled(self):
result = BytesIO()
xmlgen = XMLGenerator(result)
Index: Python-3.14.0b4/Lib/test/test_xml_etree.py
===================================================================
--- Python-3.14.0b4.orig/Lib/test/test_xml_etree.py 2025-07-09 07:53:01.649732434 +0200
+++ Python-3.14.0b4/Lib/test/test_xml_etree.py 2025-07-09 07:55:44.223264648 +0200
@@ -138,6 +138,11 @@
return mock.patch.object(cls, "__eq__", autospec=True, wraps=eq)
+IS_SLE_15_7 = os.environ.get("SLE_VERSION", "") == "0150700"
+fails_with_expat_2_6_0 = (unittest.expectedFailure
+ # 2.4 version patched in SLE
+ if IS_SLE_15_7 and pyexpat.version_info >= (2, 4, 0) else
+ lambda test: test)
def checkwarnings(*filters, quiet=False):
def decorator(test):
def newtest(*args, **kwargs):
@@ -1547,9 +1552,11 @@
self.assert_event_tags(parser, [('end', 'root')])
self.assertIsNone(parser.close())
+ @fails_with_expat_2_6_0
def test_simple_xml_chunk_1(self):
self.test_simple_xml(chunk_size=1, flush=True)
+ @fails_with_expat_2_6_0
def test_simple_xml_chunk_5(self):
self.test_simple_xml(chunk_size=5, flush=True)
@@ -1774,6 +1781,9 @@
self.assert_event_tags(parser, [('end', 'doc')])
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ f'Expat {pyexpat.version_info} does not '
+ 'support reparse deferral')
def test_flush_reparse_deferral_disabled(self):
parser = ET.XMLPullParser(events=('start', 'end'))