diff --git a/py314.patch b/py314.patch new file mode 100644 index 0000000..d258c0b --- /dev/null +++ b/py314.patch @@ -0,0 +1,51 @@ +From 6286442857de9f734686d08f0e59ca8048ee357a Mon Sep 17 00:00:00 2001 +From: Vinay Sajip +Date: Fri, 18 Jul 2025 07:59:29 +0100 +Subject: [PATCH] Fix #251: Use more appropriate function in test. + +--- + CHANGES.rst | 4 ++++ + docs/tutorial.rst | 3 +-- + tests/test_scripts.py | 6 ++---- + 3 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/CHANGES.rst b/CHANGES.rst +index 290be09..d6aefc2 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -6,6 +6,10 @@ Change log for ``distlib`` + + Released: Not yet. + ++- tests ++ ++ - Fix #251: Change test function following a reorganization which happened in the Python stdlib. ++ + 0.4.0 + ~~~~~ + +diff --git a/tests/test_scripts.py b/tests/test_scripts.py +index a93a08a..99417c5 100644 +--- a/tests/test_scripts.py ++++ b/tests/test_scripts.py +@@ -341,10 +341,8 @@ def test_dry_run(self): + def test_script_run(self): + if sys.version_info[:2] < (3, 13): + target = 'cgi:print_directory' +- elif os.name != 'nt': +- target = 'test.support.interpreters:list_all' + else: +- raise unittest.SkipTest('test not available on Windows for Python >= 3.13') ++ target = 'logging:getHandlerNames' + files = self.maker.make('test = %s' % target) + self.assertEqual(len(files), 2) + p = subprocess.Popen([sys.executable, files[0]], stdout=subprocess.PIPE, stderr=subprocess.PIPE) +@@ -353,7 +351,7 @@ def test_script_run(self): + self.assertIn(b'

Current Working Directory:

', stdout) + self.assertIn(os.getcwd().encode('utf-8'), stdout) + else: +- self.assertIn(b'[Interpreter(0)]', stderr) ++ self.assertIn(b'frozenset(', stderr) + self.assertEqual(p.returncode, 1) + + @unittest.skipUnless(os.name == 'posix', 'Test only valid for POSIX') diff --git a/python-distlib.changes b/python-distlib.changes index 09bbf98..6ec1ad8 100644 --- a/python-distlib.changes +++ b/python-distlib.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 8 13:34:53 UTC 2025 - Markéta Machová + +- Add py314.patch to fix tests with Python 3.14 + ------------------------------------------------------------------- Wed Jul 23 09:15:41 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-distlib.spec b/python-distlib.spec index 6e27e01..405dd8a 100644 --- a/python-distlib.spec +++ b/python-distlib.spec @@ -1,7 +1,7 @@ # # spec file for package python-distlib # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 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 @@ -24,6 +24,8 @@ Summary: Distribution utilities License: Python-2.0 URL: https://github.com/pypa/distlib Source: https://files.pythonhosted.org/packages/source/d/distlib/distlib-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/pypa/distlib/commit/6286442857de9f734686d08f0e59ca8048ee357a Fix #251: Use more appropriate function in test. +Patch0: py314.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module testsuite}