summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2009-07-19 04:20:12 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2009-07-19 04:20:12 (GMT)
commite9da06f57443fd8cfe9e16fb950cfaf84a41f735 (patch)
tree31ae4487ec44cf4ba59b6c1ad19aefdbfaf4e4c1 /Lib/urllib
parent10fc39563cdb2953bc0eae634ac1efd2ff82eb5d (diff)
downloadcpython-e9da06f57443fd8cfe9e16fb950cfaf84a41f735.zip
cpython-e9da06f57443fd8cfe9e16fb950cfaf84a41f735.tar.gz
cpython-e9da06f57443fd8cfe9e16fb950cfaf84a41f735.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/urllib')
-rw-r--r--Lib/urllib/request.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index bb67267..b133fe4 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -552,7 +552,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
@@ -669,7 +669,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:
@@ -785,7 +785,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
@@ -866,7 +866,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):