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:
Facundo Batista 2008-05-29 16:39:26 +00:00
parent f18a707205
commit 4f1b1ed975
24 changed files with 231 additions and 180 deletions

View file

@ -76,7 +76,8 @@ class POP3:
"""
def __init__(self, host, port=POP3_PORT, timeout=None):
def __init__(self, host, port=POP3_PORT,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
self.host = host
self.port = port
self.sock = socket.create_connection((host, port), timeout)