diff --git a/python-tblib.changes b/python-tblib.changes index 0b49517..b9100e2 100644 --- a/python-tblib.changes +++ b/python-tblib.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 9 12:30:08 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick patch from Fedora to fix testsuite with Python 3.13 + * test_pickle_exception-even-harder-location-stripping.patch + ------------------------------------------------------------------- Fri May 31 22:34:24 UTC 2024 - Matej Cepl diff --git a/python-tblib.spec b/python-tblib.spec index 93fa21e..0d42e2c 100644 --- a/python-tblib.spec +++ b/python-tblib.spec @@ -37,6 +37,8 @@ Source: https://files.pythonhosted.org/packages/source/t/tblib/tblib-%{v Patch0: vendore-reraise-from-six.patch # PATCH-FIX-UPSTREAM https://github.com/ionelmc/python-tblib/issues/74 More aggressive location stripping. Ref #74. Patch1: more-aggressive-location-stripping.patch +# PATCH-FIX-FEDORA https://src.fedoraproject.org/rpms/python-tblib/blob/rawhide/f/0001-test_pickle_exception-even-harder-location-stripping.patch +Patch2: test_pickle_exception-even-harder-location-stripping.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} diff --git a/test_pickle_exception-even-harder-location-stripping.patch b/test_pickle_exception-even-harder-location-stripping.patch new file mode 100644 index 0000000..ce3ba14 --- /dev/null +++ b/test_pickle_exception-even-harder-location-stripping.patch @@ -0,0 +1,42 @@ +From 11329603da1f9600e29bbd8f2c2a704ae0062e49 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Tue, 18 Jun 2024 12:19:02 -0700 +Subject: [PATCH] test_pickle_exception: even harder location stripping. Ref + #74. + +With Python 3.13, we need to strip even harder, because we get +location lines with differing amounts of tildes and up carets in +them, e.g.: + + ~~^~~~~ + +and: + + ^^^^^^^ + +Let's ditch the regex and instead go line-by-line with a pretty +loose match for anything that looks like a location line. + +Signed-off-by: Adam Williamson +--- + tests/test_pickle_exception.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/test_pickle_exception.py b/tests/test_pickle_exception.py +index 53a9dce..afe0d69 100644 +--- a/tests/test_pickle_exception.py ++++ b/tests/test_pickle_exception.py +@@ -30,7 +30,9 @@ class CustomError(Exception): + + + def strip_locations(tb_text): +- return tb_text.replace(' ~~^~~\n', '').replace(' ^^^^^^^^^^^^^^^^^\n', '') ++ lines = tb_text.splitlines() ++ lines = [line for line in lines if '~~^~~' not in line and '^^^^' not in line] ++ return '\n'.join(lines) + + + @pytest.mark.parametrize('protocol', [None, *list(range(1, pickle.HIGHEST_PROTOCOL + 1))]) +-- +2.45.2 +