summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2008-05-29 16:39:26 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2008-05-29 16:39:26 (GMT)
commit4f1b1ed975fe25170d00559e63f992c9bf8e9b8a (patch)
tree0f2a0434dc9ad0181633f649611e417aa4a6ea61 /Lib/httplib.py
parentf18a70720542268586e271bbadab3fb0332b8a39 (diff)
downloadcpython-4f1b1ed975fe25170d00559e63f992c9bf8e9b8a.zip
cpython-4f1b1ed975fe25170d00559e63f992c9bf8e9b8a.tar.gz
cpython-4f1b1ed975fe25170d00559e63f992c9bf8e9b8a.tar.bz2
Fixed the semantic of timeout for socket.create_connection and
all the upper level libraries that use it, including urllib2. Added and fixed some tests, and changed docs correspondingly. Thanks to John J Lee for the patch and the pusing, :)
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 5696467..1bca5da 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -639,7 +639,8 @@ class HTTPConnection:
debuglevel = 0
strict = 0
- def __init__(self, host, port=None, strict=None, timeout=None):
+ def __init__(self, host, port=None, strict=None,
+ timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
self.timeout = timeout
self.sock = None
self._buffer = []
@@ -1055,7 +1056,7 @@ else:
default_port = HTTPS_PORT
def __init__(self, host, port=None, key_file=None, cert_file=None,
- strict=None, timeout=None):
+ strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
HTTPConnection.__init__(self, host, port, strict, timeout)
self.key_file = key_file
self.cert_file = cert_file