cpython: e0ec68d46464 (original) (raw)

Mercurial > cpython

changeset 101316:e0ec68d46464

merge from 3.5 Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch contributed by Chi Hsuan Yen. [#26892]

Senthil Kumaran senthil@uthcode.com
date Fri, 13 May 2016 01:35:29 -0700
parents 5979e7aadd59(current diff)63e23b2dedcc(diff)
children 175c3f1d0256
files Lib/test/test_urllib2.py Lib/urllib/request.py Misc/NEWS
diffstat 3 files changed, 13 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_urllib2.py 11 Lib/urllib/request.py 1 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -480,8 +480,8 @@ class MockHTTPSHandler(urllib.request.Ab # Useful for testing the Proxy-Authorization request by verifying the # properties of httpcon

def https_open(self, req): @@ -950,6 +950,13 @@ class HandlerTests(unittest.TestCase): newreq = h.do_request_(req) self.assertEqual(int(newreq.get_header('Content-length')),16)

+ def test_http_doubleslash(self): # Checks the presence of any unnecessary double slash in url does not # break anything. Previously, a double slash directly after the host

--- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1271,6 +1271,7 @@ class AbstractHTTPHandler(BaseHandler): # will parse host:port h = http_class(host, timeout=req.timeout, **http_conn_args)

headers = dict(req.unredirected_hdrs) headers.update(dict((k, v) for k, v in req.headers.items()

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -277,6 +277,9 @@ Core and Builtins Library ------- +- Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch