summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2009-07-19 02:43:43 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2009-07-19 02:43:43 (GMT)
commit5fee460bfabc248ca8c14fc2403fdfabf5051dad (patch)
tree8090bef8304ca359e9c0071b6cc17d518997c7b0 /Lib/urllib2.py
parent5215875a95c0a08a688e897f4675be038f83a117 (diff)
downloadcpython-5fee460bfabc248ca8c14fc2403fdfabf5051dad.zip
cpython-5fee460bfabc248ca8c14fc2403fdfabf5051dad.tar.gz
cpython-5fee460bfabc248ca8c14fc2403fdfabf5051dad.tar.bz2
Fix for issue5102, timeout value propages between redirects, proxy, digest and
auth handlers. Fixed tests to reflect the same.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 03aaf79..7ccf14b 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -600,7 +600,7 @@ class HTTPRedirectHandler(BaseHandler):
fp.read()
fp.close()
- return self.parent.open(new)
+ return self.parent.open(new, timeout=req.timeout)
http_error_301 = http_error_303 = http_error_307 = http_error_302
@@ -716,7 +716,7 @@ class ProxyHandler(BaseHandler):
# {'http': 'ftp://proxy.example.com'}, we may end up turning
# a request for http://acme.example.com/a into one for
# ftp://proxy.example.com/a
- return self.parent.open(req)
+ return self.parent.open(req, timeout=req.timeout)
class HTTPPasswordMgr:
@@ -832,7 +832,7 @@ class AbstractBasicAuthHandler:
if req.headers.get(self.auth_header, None) == auth:
return None
req.add_header(self.auth_header, auth)
- return self.parent.open(req)
+ return self.parent.open(req, timeout=req.timeout)
else:
return None
@@ -923,7 +923,7 @@ class AbstractDigestAuthHandler:
if req.headers.get(self.auth_header, None) == auth_val:
return None
req.add_unredirected_header(self.auth_header, auth_val)
- resp = self.parent.open(req)
+ resp = self.parent.open(req, timeout=req.timeout)
return resp
def get_cnonce(self, nonce):