From ad3c25779f3809f21f2c758ae3419f64ff3d45a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 12 Feb 2026 12:24:39 +0100 Subject: [PATCH] DO NOT MERGE Test my upstream PR --- 144740.patch | 39 +++++++++++++++++++++++++++++++++++++++ python3.13.spec | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 144740.patch diff --git a/144740.patch b/144740.patch new file mode 100644 index 0000000..4712fac --- /dev/null +++ b/144740.patch @@ -0,0 +1,39 @@ +From ffdb2045006640a7994d4e20a18f6d0cae45624e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Thu, 12 Feb 2026 12:12:11 +0100 +Subject: [PATCH] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on + expat compile-time version, not runtime + +--- + Lib/test/test_pyexpat.py | 4 +++- + .../next/Tests/2026-02-12-12-12-00.gh-issue-144739.-fx1tN.rst | 3 +++ + 2 files changed, 6 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Tests/2026-02-12-12-12-00.gh-issue-144739.-fx1tN.rst + +diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py +index 042a3bb9df9..1d0d8ceaa7f 100644 +--- a/Lib/test/test_pyexpat.py ++++ b/Lib/test/test_pyexpat.py +@@ -1000,7 +1000,9 @@ def test_set_maximum_amplification__fail_for_subparser(self): + self.assert_root_parser_failure(setter, 123.45) + + +-@unittest.skipIf(expat.version_info < (2, 7, 2), "requires Expat >= 2.7.2") ++@unittest.skipIf(not hasattr(expat.XMLParserType, ++ "SetAllocTrackerMaximumAmplification"), ++ "requires Python compiled with Expat >= 2.7.2") + class MemoryProtectionTest(AttackProtectionTestBase, unittest.TestCase): + + # NOTE: with the default Expat configuration, the billion laughs protection +diff --git a/Misc/NEWS.d/next/Tests/2026-02-12-12-12-00.gh-issue-144739.-fx1tN.rst b/Misc/NEWS.d/next/Tests/2026-02-12-12-12-00.gh-issue-144739.-fx1tN.rst +new file mode 100644 +index 00000000000..955ec49ee4f +--- /dev/null ++++ b/Misc/NEWS.d/next/Tests/2026-02-12-12-12-00.gh-issue-144739.-fx1tN.rst +@@ -0,0 +1,3 @@ ++When Python was compiled with system expat older then 2.7.2 but tests run ++with newer expat, still skip ++:class:`test.test_pyexpat.MemoryProtectionTest`. +-- +2.53.0 + diff --git a/python3.13.spec b/python3.13.spec index df66054..ad0917b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -421,6 +421,8 @@ Patch475: 00475-cve-2025-15367.patch # direct call to the check function. Patch477: 00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch +Patch144740: 144740.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc.,