diff options
author | Facundo Batista <facundobatista@gmail.com> | 2008-05-29 16:39:26 (GMT) |
---|---|---|
committer | Facundo Batista <facundobatista@gmail.com> | 2008-05-29 16:39:26 (GMT) |
commit | 4f1b1ed975fe25170d00559e63f992c9bf8e9b8a (patch) | |
tree | 0f2a0434dc9ad0181633f649611e417aa4a6ea61 /Lib/smtplib.py | |
parent | f18a70720542268586e271bbadab3fb0332b8a39 (diff) | |
download | cpython-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/smtplib.py')
-rwxr-xr-x | Lib/smtplib.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 5ac9fc3..afa38bc 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -220,7 +220,8 @@ class SMTP: ehlo_resp = None does_esmtp = 0 - def __init__(self, host='', port=0, local_hostname=None, timeout=None): + def __init__(self, host='', port=0, local_hostname=None, + timeout=socket._GLOBAL_DEFAULT_TIMEOUT): """Initialize a new instance. If specified, `host' is the name of the remote host to which to @@ -741,7 +742,8 @@ if _have_ssl: certificate chain file for the SSL connection. """ def __init__(self, host='', port=0, local_hostname=None, - keyfile=None, certfile=None, timeout=None): + keyfile=None, certfile=None, + timeout=socket._GLOBAL_DEFAULT_TIMEOUT): self.keyfile = keyfile self.certfile = certfile SMTP.__init__(self, host, port, local_hostname, timeout) |