From 9b84183aca48468909b57a79ea2a6383d979fab1 Mon Sep 17 00:00:00 2001 From: Tomas Hoger Date: Thu, 25 Jan 2018 09:27:01 +0100 Subject: [PATCH] Fix FTBFS - Move RECENT_DATE to 2017-06-30 As of 2018-01-01, python-urllib3 no longer builds because of the test suite failure caused by RECENT_DATE not being recent enough. RECENT_DATE was updated to 2017-06-30 upstream. https://github.com/shazow/urllib3/issues/1303 https://github.com/shazow/urllib3/commit/4bff1e93d2dd4663d422d7e290473d9189cec5db --- python-urllib3-recent-date.patch | 32 ++++++++++++++++++++++++++++++++ python-urllib3.spec | 8 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 python-urllib3-recent-date.patch diff --git a/python-urllib3-recent-date.patch b/python-urllib3-recent-date.patch new file mode 100644 index 0000000..720d76f --- /dev/null +++ b/python-urllib3-recent-date.patch @@ -0,0 +1,32 @@ +From 4bff1e93d2dd4663d422d7e290473d9189cec5db Mon Sep 17 00:00:00 2001 +From: Dominique Leuenberger +Date: Sun, 31 Dec 2017 15:11:16 +0100 +Subject: [PATCH] Move RECENT_DATE to 2017-06-30 + +The test suite expects the current date to be no more than two years in the future +of RECENT_DATE, which just serves as a reference point. + +Also clarify the comment about how to update RECENT_DATE + +Fixes #1303 + +diff --git a/urllib3/connection.py b/urllib3/connection.py +index 06bcbde1a..a03b573f0 100644 +--- a/urllib3/connection.py ++++ b/urllib3/connection.py +@@ -56,10 +56,11 @@ class ConnectionError(Exception): + 'https': 443, + } + +-# When updating RECENT_DATE, move it to +-# within two years of the current date, and no +-# earlier than 6 months ago. +-RECENT_DATE = datetime.date(2016, 1, 1) ++# When updating RECENT_DATE, move it to within two years of the current date, ++# and not less than 6 months ago. ++# Example: if Today is 2018-01-01, then RECENT_DATE should be any date on or ++# after 2016-01-01 (today - 2 years) AND before 2017-07-01 (today - 6 months) ++RECENT_DATE = datetime.date(2017, 6, 30) + + + class DummyConnection(object): diff --git a/python-urllib3.spec b/python-urllib3.spec index 7afe4cf..fa3a7e5 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -2,7 +2,7 @@ Name: python-%{srcname} Version: 1.22 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Python HTTP library with thread-safe connection pooling and file post License: MIT @@ -10,6 +10,8 @@ URL: https://github.com/shazow/urllib3 Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz # Used with Python 3.5+ Source1: ssl_match_hostname_py3.py +# https://github.com/shazow/urllib3/commit/4bff1e93d2dd4663d422d7e290473d9189cec5db +Patch0: python-urllib3-recent-date.patch BuildArch: noarch %description @@ -75,6 +77,7 @@ Python3 HTTP module with connection pooling and file POST abilities. %prep %setup -q -n %{srcname}-%{version} +%patch0 -p1 -b .recent-date # Drop the dummyserver tests in koji. They fail there in real builds, but not # in scratch builds (weird). rm -rf test/with_dummyserver/ @@ -139,6 +142,9 @@ py.test-3 %changelog +* Thu Jan 25 2018 Tomas Hoger - 1.22-4 +- Fix FTBFS - Move RECENT_DATE to 2017-06-30 + * Fri Dec 01 2017 Jeremy Cline - 1.22-3 - Symlink the Python 3 bytecode for six (rbhz 1519147)