From a15f7b0fad5f70f381ba167e9a0d3ed5456e54884aaf47b334385fe4f7fba091 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 17 Oct 2024 12:39:27 +0000 Subject: [PATCH] - Add fix_test_generated_data.patch to skip failing test (gh#python/cpython#121938). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python314?expand=0&rev=16 --- ...3-52425-libexpat-2.6.0-backport-15.6.patch | 12 ------- fix_test_generated_data.patch | 34 +++++++++++++++++++ python314.changes | 2 ++ python314.spec | 3 ++ 4 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 fix_test_generated_data.patch diff --git a/CVE-2023-52425-libexpat-2.6.0-backport-15.6.patch b/CVE-2023-52425-libexpat-2.6.0-backport-15.6.patch index 2ebfe4e..8bb9293 100644 --- a/CVE-2023-52425-libexpat-2.6.0-backport-15.6.patch +++ b/CVE-2023-52425-libexpat-2.6.0-backport-15.6.patch @@ -17,18 +17,6 @@ started = [] def start_element(name, _): ---- a/Lib/test/test_sax.py -+++ b/Lib/test/test_sax.py -@@ -1241,6 +1241,9 @@ class ExpatReaderTest(XmlTestBase): - - 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) --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -121,6 +121,11 @@ ATTLIST_XML = """\ diff --git a/fix_test_generated_data.patch b/fix_test_generated_data.patch new file mode 100644 index 0000000..0cb8569 --- /dev/null +++ b/fix_test_generated_data.patch @@ -0,0 +1,34 @@ +--- + Lib/test/test_ctypes/test_generated_structs.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/Lib/test/test_ctypes/test_generated_structs.py ++++ b/Lib/test/test_ctypes/test_generated_structs.py +@@ -12,6 +12,7 @@ Run this module to regenerate the files: + import unittest + from test.support import import_helper + import re ++import sys + from dataclasses import dataclass + from functools import cached_property + +@@ -21,6 +22,11 @@ from ctypes import sizeof, alignment, po + _ctypes_test = import_helper.import_module("_ctypes_test") + + ++def is_32bit(): ++ # or alternatively (slightly slower) ++ # (struct.calcsize("P") * 8) == 32 ++ return not (sys.maxsize > 2**32) ++ + # ctypes erases the difference between `c_int` and e.g.`c_int16`. + # To keep it, we'll use custom subclasses with the C name stashed in `_c_name`: + class c_bool(ctypes.c_bool): +@@ -415,6 +421,7 @@ class AnonBitfields(Structure): + + + class GeneratedTest(unittest.TestCase): ++ @unittest.skipIf(is_32bit(), 'fails on 32bit platform (gh#python/cpython#121938)') + def test_generated_data(self): + """Check that a ctypes struct/union matches its C equivalent. + diff --git a/python314.changes b/python314.changes index 3afbc98..513b894 100644 --- a/python314.changes +++ b/python314.changes @@ -23,6 +23,8 @@ Wed Oct 16 07:00:15 UTC 2024 - Matej Cepl - Add fix_test_ftp_error.patch to mark test_ftp_error as requiring network access, and explicitly declare we have no network. +- Add fix_test_generated_data.patch to skip failing test + (gh#python/cpython#121938). ------------------------------------------------------------------- Thu Oct 10 11:18:19 UTC 2024 - Matej Cepl diff --git a/python314.spec b/python314.spec index 502ee9c..478b26d 100644 --- a/python314.spec +++ b/python314.spec @@ -215,6 +215,9 @@ Patch41: gh125535-Lib_IntVector_Intrinsics_vec128.patch # PATCH-FIX-UPSTREAM fix_test_ftp_error.patch gh#python/cpython#125584 mcepl@suse.com # Patch from gh#python/cpython!125586 Patch42: fix_test_ftp_error.patch +# PATCH-FIX-UPSTREAM fix_test_generated_data.patch gh#python/cpython#121938 mcepl@suse.com +# skip the failing test on 32bit arch +Patch43: fix_test_generated_data.patch BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: fdupes