python-urllib3/0003-Move-RECENT_DATE-to-2017-06-30.patch

38 lines
1.3 KiB
Diff

From 4bff1e93d2dd4663d422d7e290473d9189cec5db Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
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
---
urllib3/connection.py | 9 +++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/urllib3/connection.py b/urllib3/connection.py
index 06bcbde1af7af11257357d9f786fb4b0976063fd..a03b573f01d82973f8d64a0bac4819eec63c24c6 100644
--- a/urllib3/connection.py
+++ b/urllib3/connection.py
@@ -56,10 +56,11 @@ port_by_scheme = {
'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):
--
2.17.0