diff --git a/bf24b7.patch b/bf24b7.patch new file mode 100644 index 0000000..7b5e21d --- /dev/null +++ b/bf24b7.patch @@ -0,0 +1,22 @@ +From bf24b7d8d17da34be720c19e5978b2d3bf94a53b Mon Sep 17 00:00:00 2001 +From: franekmagiera +Date: Sun, 12 May 2024 22:08:24 +0200 +Subject: [PATCH] Use an invalid URI that will not cause httpbin to throw 500 + +--- + tests/test_requests.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_requests.py b/tests/test_requests.py +index d05febeef5..b4e9fe92ae 100644 +--- a/tests/test_requests.py ++++ b/tests/test_requests.py +@@ -2721,7 +2721,7 @@ def test_preparing_bad_url(self, url): + with pytest.raises(requests.exceptions.InvalidURL): + r.prepare() + +- @pytest.mark.parametrize("url, exception", (("http://localhost:-1", InvalidURL),)) ++ @pytest.mark.parametrize("url, exception", (("http://:1", InvalidURL),)) + def test_redirecting_to_bad_url(self, httpbin, url, exception): + with pytest.raises(exception): + requests.get(httpbin("redirect-to"), params={"url": url}) diff --git a/python-requests.spec b/python-requests.spec index 2fd5d3e..1fd1522 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -24,6 +24,9 @@ Patch: system-certs.patch # This change is backported also into RHEL 9.4 (via CS) Patch: support_IPv6_CIDR_in_no_proxy.patch +# Fix FTBFS (test_redirecting_to_bad_url) +Patch: https://github.com/psf/requests/commit/bf24b7.patch + BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %if %{with tests} @@ -100,6 +103,7 @@ sed -i "/pytest.warns/s/None//" tests/test_requests.py %changelog * Tue May 14 2024 Lumír Balhar - 2.31.0-5 - Add support for IPv6 CIDR in no_proxy setting +- Fix FTBFS * Thu Apr 11 2024 Lumír Balhar - 2.31.0-4 - Fix compatibility with pytest 8