File 03-v2.20.0...v2.20.1.patch of Package python-requests.23814

From a1f4e62aa4724bffbc3e35b960afc26302442af1 Mon Sep 17 00:00:00 2001
From: Nate Prewitt <Nate.Prewitt@gmail.com>
Date: Thu, 18 Oct 2018 08:58:48 -0700
Subject: [PATCH 1/7] fix broken HISTORY.md reference

---
 requests/utils.py      |    4 +++-
 tests/test_requests.py |   11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

--- a/requests/utils.py
+++ b/requests/utils.py
@@ -40,6 +40,8 @@ DEFAULT_CA_BUNDLE_PATH = certs.where()
 
 DEFAULT_PORTS = {'http': 80, 'https': 443}
 
+DEFAULT_PORTS = {'http': 80, 'https': 443}
+
 
 if platform.system() == 'Windows':
     # provide a proxy_bypass version on Windows without DNS lookups
@@ -228,7 +230,7 @@ def from_key_val_list(value):
         >>> from_key_val_list([('key', 'val')])
         OrderedDict([('key', 'val')])
         >>> from_key_val_list('string')
-        ValueError: need more than 1 value to unpack
+        ValueError: cannot encode objects that are not 2-tuples
         >>> from_key_val_list({'key': 'val'})
         OrderedDict([('key', 'val')])
 
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -1529,6 +1529,17 @@ class TestRequests:
         s = requests.Session()
         assert not s.should_strip_auth(old_uri, new_uri)
 
+    @pytest.mark.parametrize(
+        'old_uri, new_uri', (
+            ('https://example.com:443/foo', 'https://example.com/bar'),
+            ('http://example.com:80/foo', 'http://example.com/bar'),
+            ('https://example.com/foo', 'https://example.com:443/bar'),
+            ('http://example.com/foo', 'http://example.com:80/bar')
+        ))
+    def test_should_strip_auth_default_port(self, old_uri, new_uri):
+        s = requests.Session()
+        assert not s.should_strip_auth(old_uri, new_uri)
+
     def test_manual_redirect_with_partial_body_read(self, httpbin):
         s = requests.Session()
         r1 = s.get(httpbin('redirect/2'), allow_redirects=False, stream=True)
openSUSE Build Service is sponsored by