mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
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, :)
This commit is contained in:
parent
f18a707205
commit
4f1b1ed975
24 changed files with 231 additions and 180 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue