diff --git a/0002-Skip-tests-with-system-expat-2.5.0.patch b/0002-Skip-tests-with-system-expat-2.5.0.patch new file mode 100644 index 0000000000000000000000000000000000000000..5691f54f7a2be61a651cd60f4d329d82b55d7177 --- /dev/null +++ b/0002-Skip-tests-with-system-expat-2.5.0.patch @@ -0,0 +1,76 @@ +From d4381e98eeb9d17fec584a1f804c2de2e1e9a4f8 Mon Sep 17 00:00:00 2001 +From: taifu.gc +Date: Tue, 24 Dec 2024 21:50:40 +0800 +Subject: [PATCH] Skip test with system expat 2.5.0 + +--- + Lib/test/test_pyexpat.py | 3 +++ + Lib/test/test_sax.py | 5 ++++- + Lib/test/test_xml_etree.py | 11 ++++++++++- + 3 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py +index 5212c7a..1a40100 100644 +--- a/Lib/test/test_pyexpat.py ++++ b/Lib/test/test_pyexpat.py +@@ -766,6 +766,9 @@ class ReparseDeferralTest(unittest.TestCase): + 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, _): +diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py +index 9b3014a..025838c 100644 +--- a/Lib/test/test_sax.py ++++ b/Lib/test/test_sax.py +@@ -1239,7 +1239,10 @@ class ExpatReaderTest(XmlTestBase): + parser.close() + + self.assertEqual(result.getvalue(), start + b"") +- ++ ++ @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) +diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py +index d0445da..2fe1a3a 100644 +--- a/Lib/test/test_xml_etree.py ++++ b/Lib/test/test_xml_etree.py +@@ -1420,9 +1420,15 @@ class XMLPullParserTest(unittest.TestCase): + self.assert_event_tags(parser, [('end', 'root')]) + self.assertIsNone(parser.close()) + ++ @unittest.skipIf(pyexpat.version_info < (2, 6, 0), ++ f'Expat {pyexpat.version_info} does not ' ++ 'support reparse deferral') + def test_simple_xml_chunk_1(self): + self.test_simple_xml(chunk_size=1, flush=True) + ++ @unittest.skipIf(pyexpat.version_info < (2, 6, 0), ++ f'Expat {pyexpat.version_info} does not ' ++ 'support reparse deferral') + def test_simple_xml_chunk_5(self): + self.test_simple_xml(chunk_size=5, flush=True) + +@@ -1646,7 +1652,10 @@ class XMLPullParserTest(unittest.TestCase): + parser.close() + + 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')) + +-- +2.41.0 + diff --git a/python3.10.spec b/python3.10.spec index f688e73a4dac30a0d5e59247e08d2ad0d2abb76b..cb79c4c3b1ec08b14ff1a90fce4076724645dab5 100644 --- a/python3.10.spec +++ b/python3.10.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release 2 %global __python3 /usr/bin/python3.10 # ================== @@ -20,7 +20,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{anolis_release}%{?dist} +Release: %{anolis_release}%{?dist} License: Python-2.0.1 @@ -189,7 +189,8 @@ BuildRequires: bzip2 BuildRequires: bzip2-devel BuildRequires: desktop-file-utils # See the runtime requirement in the -libs subpackage -BuildRequires: expat-devel >= 2.6 +# Version limitation Removed by OpenAnolis +BuildRequires: expat-devel BuildRequires: findutils BuildRequires: gcc-c++ @@ -331,6 +332,9 @@ Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-g # https://github.com/fedora-python/cpython # add loongarch64 support Patch1001: 0001-add-loongarch64-support-for-python-3.10.12.patch +# Added by OpenAnolis +# Reference: https://github.com/python/cpython/issues/125067 +Patch0002: 0002-Skip-tests-with-system-expat-2.5.0.patch # ========================================== # Descriptions, and metadata for subpackages @@ -468,7 +472,9 @@ Requires: tzdata # undefined symbol: XML_SetReparseDeferralEnabled # This breaks many things, including python -m venv. # Other subpackages (like -debug) also need this, but they all depend on -libs. -Requires: expat >= 2.6 + +# Version limitation Removed by OpenAnolis +Requires: expat # Since patch 251 changed from distutils to sysconfig, pip needed to be adapted # The previous versions could cause serious bugs during `sudo pip install --upgrade ...` @@ -1602,5 +1608,8 @@ CheckPython optimized # ====================================================== %changelog +* Tue Dec 24 2024 gaochang - 3.10.15-2 +- Skip some tests in check stage do not compatible with expat 2.5.0 + * Wed Oct 16 2024 mgb01105731 - 3.10.15-1 - Init 3.10.15