From 9af2b2740ccc68d31e962ed2a8f10ff9d2afcb2d Mon Sep 17 00:00:00 2001 From: starlet-dx <15929766099@163.com> Date: Wed, 11 Jan 2023 11:14:16 +0800 Subject: [PATCH] Fix the publicsuffix2 build error caused by the python-charset-normalizer update --- ...t-normalizer-version-between-2-and-4.patch | 55 +++++++++++++++++++ python-requests.spec | 6 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Allow-charset-normalizer-version-between-2-and-4.patch diff --git a/Allow-charset-normalizer-version-between-2-and-4.patch b/Allow-charset-normalizer-version-between-2-and-4.patch new file mode 100644 index 0000000..78f6b6e --- /dev/null +++ b/Allow-charset-normalizer-version-between-2-and-4.patch @@ -0,0 +1,55 @@ +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/python-requests.spec b/python-requests.spec index a014f68..2cdfb68 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -2,7 +2,7 @@ Name: python-requests Version: 2.28.1 -Release: 1 +Release: 2 Summary: Python HTTP Library License: ASL 2.0 URL: http://python-requests.org/ @@ -10,6 +10,7 @@ Source0: https://github.com/requests/requests/archive/v%{version}/request 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 BuildArch: noarch @@ -94,6 +95,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v %doc HISTORY.md README.md %changelog +* Wed Jan 11 2023 yaoxin - 2.28.1-2 +- Fix the publicsuffix2 build error caused by the python-charset-normalizer update. + * Thu Jul 28 2022 fushanqing - 2.28.1-1 - update python-requests to 2.28.1 -- Gitee