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, :)
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 4cffb04..e2b33ef 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -76,7 +76,8 @@
"""
- 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)