From 5864d9290ce32061459ba49b5e8b4eafa1251e3063febf7c27c85948fd8e68e6 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 5 Feb 2026 12:23:25 +0000 Subject: [PATCH] - Add upstream string.patch to fix test failure on Python 3.14 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-coverage?expand=0&rev=154 --- python-coverage.changes | 5 +++++ python-coverage.spec | 4 +++- string.patch | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 string.patch diff --git a/python-coverage.changes b/python-coverage.changes index cc12cbe..c73fcff 100644 --- a/python-coverage.changes +++ b/python-coverage.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 5 11:16:05 UTC 2026 - Markéta Machová + +- Add upstream string.patch to fix test failure on Python 3.14 + ------------------------------------------------------------------- Mon Oct 20 08:45:59 UTC 2025 - Nico Krapp diff --git a/python-coverage.spec b/python-coverage.spec index c1e0dc6..4695881 100644 --- a/python-coverage.spec +++ b/python-coverage.spec @@ -1,7 +1,7 @@ # # spec file for package python-coverage # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -39,6 +39,8 @@ Summary: Code coverage measurement for Python License: Apache-2.0 URL: https://github.com/nedbat/coveragepy Source: https://files.pythonhosted.org/packages/source/c/coverage/coverage-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/coveragepy/coveragepy/commit/cf95edab0c3be47ab934f0425f12743745dd2da5 test: a Python error message changed slightly +Patch0: string.patch BuildRequires: %{python_module devel >= 3.9} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} diff --git a/string.patch b/string.patch new file mode 100644 index 0000000..688e37a --- /dev/null +++ b/string.patch @@ -0,0 +1,22 @@ +From cf95edab0c3be47ab934f0425f12743745dd2da5 Mon Sep 17 00:00:00 2001 +From: Ned Batchelder +Date: Tue, 21 Oct 2025 06:30:12 -0400 +Subject: [PATCH] test: a Python error message changed slightly + +--- + tests/test_execfile.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_execfile.py b/tests/test_execfile.py +index ab39b70f4..2cc4e55f8 100644 +--- a/tests/test_execfile.py ++++ b/tests/test_execfile.py +@@ -284,7 +284,7 @@ def test_running_py_from_binary(self) -> None: + path = python_reported_file("binary") + msg = ( + re.escape(f"Couldn't run '{path}' as Python code: ") +- + r"(ValueError|SyntaxError): source code string cannot contain null bytes" ++ + r"(ValueError|SyntaxError): source code (string )?cannot contain null bytes" + ) + with pytest.raises(Exception, match=msg): + run_python_file([bf])