From a8af19fd16401b67604eb6dbd57bda2598e1635c Mon Sep 17 00:00:00 2001 From: si-gui Date: Mon, 24 May 2021 20:20:50 +0800 Subject: [PATCH] fix check error by set RECENT_DATE (cherry picked from commit 51f118394fa1cfe235b2a8705dc251542785e807) --- python-urllib3.spec | 9 +++++-- ...ECENT_DATE-not-be-older-than-2-years.patch | 25 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 set-RECENT_DATE-not-be-older-than-2-years.patch diff --git a/python-urllib3.spec b/python-urllib3.spec index 69c8d67..0dea575 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -3,7 +3,7 @@ Name: python-%{srcname} Version: 1.25.9 -Release: 1 +Release: 2 Summary: Sanity-friendly HTTP client for Python License: MIT URL: https://urllib3.readthedocs.io @@ -11,6 +11,7 @@ Source0: https://github.com/urllib3/urllib3/archive/%{version}/urllib3-%{ Source1: ssl_match_hostname_py3.py BuildArch: noarch +Patch0000: set-RECENT_DATE-not-be-older-than-2-years.patch %global _description \ HTTP library with thread-safe connection pooling, file post support,\ @@ -88,7 +89,8 @@ ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc % %if %{with tests} %check -PYTHONPATH=%{buildroot}%{python2_sitelib}:%{python2_sitelib} %{__python2} -m pytest -v +#we don't have python2-trustme,so we don't need check python2 +#PYTHONPATH=%{buildroot}%{python2_sitelib}:%{python2_sitelib} %{__python2} -m pytest -v PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pytest -v %endif @@ -107,6 +109,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib} %{__python3} -m pyt %{python3_sitelib}/urllib3-*.egg-info %changelog +* Mon 24 May 2021 sunguoshuai - 1.25.9-2 +- fix check error by set RECENT_DATE + * Wed 25 Nov 2020 leiju - 1.25.9-1 - upgrade to 1.25.9 diff --git a/set-RECENT_DATE-not-be-older-than-2-years.patch b/set-RECENT_DATE-not-be-older-than-2-years.patch new file mode 100644 index 0000000..2c2e34c --- /dev/null +++ b/set-RECENT_DATE-not-be-older-than-2-years.patch @@ -0,0 +1,25 @@ +From 686ab7d843e7ad9d9782fb63f600a4942b896c2d Mon Sep 17 00:00:00 2001 +From: si-gui +Date: Mon, 24 May 2021 20:04:00 +0800 +Subject: [PATCH] set RECENT_DATE not be older than 2 years + +--- + src/urllib3/connection.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py +index 6da1cf4..29dc4d8 100644 +--- a/src/urllib3/connection.py ++++ b/src/urllib3/connection.py +@@ -57,7 +57,7 @@ port_by_scheme = {"http": 80, "https": 443} + + # When it comes time to update this value as a part of regular maintenance + # (ie test_recent_date is failing) update it to ~6 months before the current date. +-RECENT_DATE = datetime.date(2019, 1, 1) ++RECENT_DATE = datetime.date(2021, 1, 1) + + _CONTAINS_CONTROL_CHAR_RE = re.compile(r"[^-!#$%&'*+.^_`|~0-9a-zA-Z]") + +-- +2.30.0 + -- Gitee