From 3c51ad07f1c608a32bb1b7665a3756babef8de75f7d3bdf0c155cde9c9c811ad Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Thu, 26 Sep 2024 18:20:07 +0000 Subject: [PATCH] Accepting request 1203592 from home:glaubitz:branches:devel:languages:python - Cherry-pick upstream patch to fix testsuite segfault with Python 3.13 * fix-testsuite-segfault.patch OBS-URL: https://build.opensuse.org/request/show/1203592 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.interface?expand=0&rev=72 --- fix-testsuite-segfault.patch | 25 +++++++++++++++++++++++++ python-zope.interface.changes | 6 ++++++ python-zope.interface.spec | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 fix-testsuite-segfault.patch diff --git a/fix-testsuite-segfault.patch b/fix-testsuite-segfault.patch new file mode 100644 index 0000000..64935cd --- /dev/null +++ b/fix-testsuite-segfault.patch @@ -0,0 +1,25 @@ +diff --git a/src/zope/interface/common/tests/test_collections.py b/src/zope/interface/common/tests/test_collections.py +index 6d23f6f..122351a 100644 +--- a/src/zope/interface/common/tests/test_collections.py ++++ b/src/zope/interface/common/tests/test_collections.py +@@ -12,6 +12,7 @@ + + + import array ++import sys + import unittest + from collections import OrderedDict + from collections import abc +@@ -127,6 +128,12 @@ class TestVerifyObject(VerifyObjectMixin, + 'async_generator': unittest.SkipTest, + type(iter(tuple())): lambda: iter(tuple()), + } ++ if sys.version_info >= (3, 13): ++ def FrameLocalsProxy_constructor(): ++ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0]) ++ return FrameLocalsProxy(sys._getframe()) ++ FrameLocalsProxy = type([sys._getframe().f_locals for x in range(1)][0]) ++ CONSTRUCTORS[FrameLocalsProxy] = FrameLocalsProxy_constructor + + UNVERIFIABLE_RO = { + # ``array.array`` fails the ``test_auto_ro_*`` tests with and diff --git a/python-zope.interface.changes b/python-zope.interface.changes index f25c7c2..f44f88f 100644 --- a/python-zope.interface.changes +++ b/python-zope.interface.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 25 13:39:50 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix testsuite segfault with Python 3.13 + * fix-testsuite-segfault.patch + ------------------------------------------------------------------- Sun Sep 8 13:11:24 UTC 2024 - Dirk Müller diff --git a/python-zope.interface.spec b/python-zope.interface.spec index b4a9082..ebd8675 100644 --- a/python-zope.interface.spec +++ b/python-zope.interface.spec @@ -33,6 +33,8 @@ Summary: Interfaces for Python License: ZPL-2.1 URL: https://pypi.python.org/pypi/zope.interface Source: https://files.pythonhosted.org/packages/source/z/zope.interface/%{modname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM - gh/zopefoundation/zope.interface#323#issuecomment-2374076122 - Fix testsuite segfault with Python 3.13 +Patch: https://github.com/zopefoundation/zope.interface/pull/324.patch#/fix-testsuite-segfault.patch # needed for tests that try to compile things BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module pip} @@ -61,6 +63,7 @@ the Design By Contract methodology support in Python. %prep %setup -q -n %{modname}-%{version} +%patch -P0 -p1 %build %if !%{with test}