diff --git a/Allow-charset-normalizer-version-between-2-and-4.patch b/Allow-charset-normalizer-version-between-2-and-4.patch deleted file mode 100644 index 78f6b6e99f0dc666d955baa2c4247342b56b3c5c..0000000000000000000000000000000000000000 --- a/Allow-charset-normalizer-version-between-2-and-4.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 38c03ce77f9f5fd0f65cc4dcdf0f321d7aa01cb0 Mon Sep 17 00:00:00 2001 -From: starlet-dx <15929766099@163.com> -Date: Wed, 11 Jan 2023 11:00:46 +0800 -Subject: [PATCH 1/1] Allow charset normalizer >=2 and <4 (#6261) - ---- - requests/__init__.py | 4 ++-- - setup.cfg | 2 +- - setup.py | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/requests/__init__.py b/requests/__init__.py -index 7ac8e29..22db3c1 100644 ---- a/requests/__init__.py -+++ b/requests/__init__.py -@@ -80,8 +80,8 @@ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_ver - elif charset_normalizer_version: - major, minor, patch = charset_normalizer_version.split(".")[:3] - major, minor, patch = int(major), int(minor), int(patch) -- # charset_normalizer >= 2.0.0 < 3.0.0 -- assert (2, 0, 0) <= (major, minor, patch) < (3, 0, 0) -+ # charset_normalizer >= 2.0.0 < 4.0.0 -+ assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0) - else: - raise Exception("You need either charset_normalizer or chardet installed") - -diff --git a/setup.cfg b/setup.cfg -index 0a94be6..906c0f1 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -4,7 +4,7 @@ provides-extra = - socks - use_chardet_on_py3 - requires-dist = -- charset_normalizer>=2,<3 -+ charset_normalizer>=2,<4 - idna>=2.5,<4 - urllib3>=1.21.1,<1.27 - -diff --git a/setup.py b/setup.py -index 599533c..c6c0ad5 100755 ---- a/setup.py -+++ b/setup.py -@@ -59,7 +59,7 @@ if sys.argv[-1] == "publish": - sys.exit() - - requires = [ -- "charset_normalizer>=2,<3", -+ "charset_normalizer>=2,<4", - "idna>=2.5,<4", - "urllib3>=1.21.1,<1.27", - ] --- -2.30.0 - diff --git a/backport-CVE-2023-32681.patch b/backport-CVE-2023-32681.patch deleted file mode 100644 index 96800d6430cbadfa672b4eb9493dc6435bd3a4a0..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-32681.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5 Mon Sep 17 00:00:00 2001 -From: Nate Prewitt -Date: Mon, 22 May 2023 08:08:57 -0700 -Subject: [PATCH] Merge pull request from GHSA-j8r2-6x86-q33q - -Reference:https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5 -Conflict:NA - ---- - requests/sessions.py | 4 +++- - tests/test_requests.py | 20 ++++++++++++++++++++ - 2 files changed, 23 insertions(+), 1 deletion(-) - -diff --git a/requests/sessions.py b/requests/sessions.py -index 6cb3b4dae3..dbcf2a7b0e 100644 ---- a/requests/sessions.py -+++ b/requests/sessions.py -@@ -324,7 +324,9 @@ def rebuild_proxies(self, prepared_request, proxies): - except KeyError: - username, password = None, None - -- if username and password: -+ # urllib3 handles proxy authorization for us in the standard adapter. -+ # Avoid appending this to TLS tunneled requests where it may be leaked. -+ if not scheme.startswith('https') and username and password: - headers["Proxy-Authorization"] = _basic_auth_str(username, password) - - return new_proxies -diff --git a/tests/test_requests.py b/tests/test_requests.py -index b1c8dd4534..b420c44d73 100644 ---- a/tests/test_requests.py -+++ b/tests/test_requests.py -@@ -647,6 +647,26 @@ def test_proxy_authorization_preserved_on_request(self, httpbin): - - assert sent_headers.get("Proxy-Authorization") == proxy_auth_value - -+ -+ @pytest.mark.parametrize( -+ "url,has_proxy_auth", -+ ( -+ ('http://example.com', True), -+ ('https://example.com', False), -+ ), -+ ) -+ def test_proxy_authorization_not_appended_to_https_request(self, url, has_proxy_auth): -+ session = requests.Session() -+ proxies = { -+ 'http': 'http://test:pass@localhost:8080', -+ 'https': 'http://test:pass@localhost:8090', -+ } -+ req = requests.Request('GET', url) -+ prep = req.prepare() -+ session.rebuild_proxies(prep, proxies) -+ -+ assert ('Proxy-Authorization' in prep.headers) is has_proxy_auth -+ - def test_basicauth_with_netrc(self, httpbin): - auth = ("user", "pass") - wrong_auth = ("wronguser", "wrongpass") diff --git a/backport-requests-2.28.1-tests_nonet.patch b/backport-requests-2.28.1-tests_nonet.patch deleted file mode 100644 index 32e96ee8e40ace8435cfe4b8117edbe5137747b7..0000000000000000000000000000000000000000 --- a/backport-requests-2.28.1-tests_nonet.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- requests-2.28.1/tests/testserver/server.py 2022-06-29 08:09:11.000000000 -0700 -+++ requests-2.28.1/tests/testserver/server.py.new 2022-07-12 14:04:30.218077055 -0700 -@@ -29,7 +29,7 @@ - def __init__( - self, - handler=None, -- host="localhost", -+ host="127.0.0.1", - port=0, - requests_to_handle=1, - wait_to_close_event=None, diff --git a/backport-requests-2.28.1-system-certs.patch b/backport-requests-2.31.0-system-certs.patch similarity index 35% rename from backport-requests-2.28.1-system-certs.patch rename to backport-requests-2.31.0-system-certs.patch index 22b96929d1b3bf308fd7230db327d54e1f82b50f..4d5c35a3baff27e5040aaa19e7d5c8f10bbd8a29 100644 --- a/backport-requests-2.28.1-system-certs.patch +++ b/backport-requests-2.31.0-system-certs.patch @@ -1,6 +1,19 @@ ---- requests-2.28.1/requests/certs.py 2022-07-12 13:55:25.378079641 -0700 -+++ requests-2.28.1/requests/certs.py.new 2022-07-12 13:57:03.834621295 -0700 -@@ -9,8 +9,13 @@ +From c8ed737d0390497b63c410a8239fea425c62a757 Mon Sep 17 00:00:00 2001 +From: lingjuer +Date: Wed, 26 Jul 2023 10:20:57 +0800 +Subject: [PATCH] backport-requests-2.31.0-system-certs + +--- + requests/certs.py | 7 ++++++- + setup.cfg | 1 - + setup.py | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/requests/certs.py b/requests/certs.py +index be422c3..1795e1c 100644 +--- a/requests/certs.py ++++ b/requests/certs.py +@@ -10,8 +10,13 @@ only one — the one from the certifi package. If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. @@ -15,23 +28,31 @@ if __name__ == "__main__": print(where()) ---- requests-2.28.1/setup.py 2022-06-29 08:09:11.000000000 -0700 -+++ requests-2.28.1/setup.py.new 2022-07-12 13:58:33.830116402 -0700 -@@ -62,7 +62,6 @@ - "charset_normalizer>=2,<3", +diff --git a/setup.cfg b/setup.cfg +index ea45aaf..056b065 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -4,7 +4,6 @@ provides-extra = + socks + use_chardet_on_py3 + requires-dist = +- certifi>=2017.4.17 + charset_normalizer>=2,<4 + idna>=2.5,<4 + urllib3>=1.21.1,<1.27 +diff --git a/setup.py b/setup.py +index 0123545..a1a50a3 100755 +--- a/setup.py ++++ b/setup.py +@@ -62,7 +62,7 @@ requires = [ + "charset_normalizer>=2,<4", "idna>=2.5,<4", - "urllib3>=1.21.1,<1.27", + "urllib3>=1.21.1,<3", - "certifi>=2017.4.17", ++ ] test_requirements = [ - "pytest-httpbin==0.0.7", ---- requests-2.28.1/setup.cfg 2022-06-29 08:09:11.000000000 -0700 -+++ requests-2.28.1/setup.cfg.new 2022-07-12 13:58:19.619038220 -0700 -@@ -4,7 +4,6 @@ - socks - use_chardet_on_py3 - requires-dist = -- certifi>=2017.4.17 - charset_normalizer>=2,<3 - idna>=2.5,<4 - urllib3>=1.21.1,<1.27 + "pytest-httpbin==2.0.0", +-- +2.39.1 + diff --git a/python-requests.spec b/python-requests.spec index b7943bbc23b88688b515bb9072cc7696eed65630..251c455ed2546d7c8f6026ad7e7da2fe52d757f1 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,18 +1,13 @@ %bcond_with tests Name: python-requests -Version: 2.28.1 -Release: 3 +Version: 2.31.0 +Release: 1 Summary: Python HTTP Library License: ASL 2.0 URL: http://python-requests.org/ -Source0: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz - -Patch6001: backport-requests-2.28.1-system-certs.patch -Patch6002: backport-requests-2.28.1-tests_nonet.patch -Patch6003: Allow-charset-normalizer-version-between-2-and-4.patch -Patch6004: backport-CVE-2023-32681.patch - +Source0: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz#/requests-%{version}.tar.gz +Patch6001: backport-requests-2.31.0-system-certs.patch BuildArch: noarch %description @@ -42,6 +37,7 @@ BuildRequires: python%{python3_pkgversion}-chardet BuildRequires: python%{python3_pkgversion}-urllib3 BuildRequires: python%{python3_pkgversion}-idna + Provides: python%{python3_pkgversion}dist(requests) = %{version} Provides: python%{python3_version}dist(requests) = %{version} @@ -96,6 +92,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v %doc HISTORY.md README.md %changelog +* Thu Jul 13 2023 zhangchenglin - 2.31.0-1 +- Update package to version 2.31.0 + * Wed May 31 2023 zhangpan - 2.28.1-3 - fix CVE-2023-32681 diff --git a/requests-2.31.0.tar.gz b/requests-2.31.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b0962abc7053dcda90c1f586d00c0fc5b9eb14ab Binary files /dev/null and b/requests-2.31.0.tar.gz differ diff --git a/requests-v2.28.1.tar.gz b/requests-v2.28.1.tar.gz deleted file mode 100644 index e2d367e20a3df9d3a2e025b24cad4cda32672b39..0000000000000000000000000000000000000000 Binary files a/requests-v2.28.1.tar.gz and /dev/null differ