diff --git a/Fix_test_error.patch b/Fix_test_error.patch new file mode 100644 index 0000000000000000000000000000000000000000..8eda4b9678174e1205983fb9764a9fb499bee05f --- /dev/null +++ b/Fix_test_error.patch @@ -0,0 +1,67 @@ +diff --git a/tests/test_debug.py b/tests/test_debug.py +index f9bba8e..7101638 100644 +--- a/tests/test_debug.py ++++ b/tests/test_debug.py +@@ -287,7 +287,8 @@ class TestTraceback: + def test_filename_encoding(self, tmpdir, monkeypatch): + moduledir = tmpdir.mkdir("föö") + moduledir.join("bar.py").write("def foo():\n 1/0\n") +- monkeypatch.syspath_prepend(str(moduledir)) ++ original_sys_path = sys.path.copy() ++ sys.path.insert(0, str(moduledir)) + + import bar # type: ignore + +@@ -297,6 +298,7 @@ class TestTraceback: + traceback = Traceback(*sys.exc_info()) + + assert "föö" in "\n".join(frame.render() for frame in traceback.frames) ++ sys.path = original_sys_path + + + def test_get_machine_id(): +diff --git a/tests/test_utils.py b/tests/test_utils.py +index 52c6f84..f080da1 100644 +--- a/tests/test_utils.py ++++ b/tests/test_utils.py +@@ -2,6 +2,7 @@ import inspect + from datetime import datetime + + import pytest ++import sys + + from werkzeug import utils + from werkzeug.datastructures import Headers +@@ -179,7 +180,9 @@ def test_import_string(): + + + def test_import_string_provides_traceback(tmpdir, monkeypatch): +- monkeypatch.syspath_prepend(str(tmpdir)) ++ original_sys_path = sys.path.copy() ++ sys.path.insert(0, str(tmpdir)) ++ + # Couple of packages + dir_a = tmpdir.mkdir("a") + dir_b = tmpdir.mkdir("b") +@@ -196,10 +199,12 @@ def test_import_string_provides_traceback(tmpdir, monkeypatch): + traceback = "".join(str(line) for line in baz_exc.traceback) + assert "bb.py':1" in traceback # a bit different than typical python tb + assert "from os import a_typo" in traceback ++ sys.path = original_sys_path + + + def test_import_string_attribute_error(tmpdir, monkeypatch): +- monkeypatch.syspath_prepend(str(tmpdir)) ++ original_sys_path = sys.path.copy() ++ sys.path.insert(0, str(tmpdir)) + tmpdir.join("foo_test.py").write("from bar_test import value") + tmpdir.join("bar_test.py").write("raise AttributeError('bad')") + +@@ -212,6 +217,7 @@ def test_import_string_attribute_error(tmpdir, monkeypatch): + utils.import_string("bar_test") + + assert "bad" in str(info.value) ++ sys.path = original_sys_path + + + def test_find_modules(): diff --git a/python-werkzeug.spec b/python-werkzeug.spec index 518581b55269a6c1eb2a688aa0ecc996bdbe688f..0e0b4e38f6cc8761f4e5e5a76f56e904be8ea756 100644 --- a/python-werkzeug.spec +++ b/python-werkzeug.spec @@ -1,7 +1,7 @@ %global _empty_manifest_terminate_build 0 Name: python-werkzeug Version: 2.0.3 -Release: 4 +Release: 5 Summary: The comprehensive WSGI web application library. License: BSD-3-Clause URL: https://palletsprojects.com/p/werkzeug/ @@ -11,6 +11,7 @@ Patch0001: backport-fix-typo-and-grammar-mistake.patch Patch0002: backport-fix-flake8-bugbear-finding.patch Patch0003: CVE-2023-23934.patch Patch0004: CVE-2023-25577.patch +Patch0005: Fix_test_error.patch BuildArch: noarch BuildRequires: python3-werkzeug @@ -180,6 +181,9 @@ export PYTHONPATH=$PYTHONPATH:$depath %{_docdir}/* %changelog +* Thu Nov 21 2024 tzing_t - 2.0.3-5 +- Fix test error + * Mon Aug 14 2023 yaoxin - 2.0.3-4 - Fix CVE-2023-23934 and CVE-2023-25577