Message213321
The documentation for smtplib.SMTP says "If the connect() call returns anything other than a success code, an SMTPConnectError is raised." It doesn't explicitly specify what happens when connect() raises instead of returns, but I think either the documentation should mention "socket.timeout" or it should raise SMTPConnectError.
Python 3.3.4 (default, Feb 11 2014, 15:56:08)
[GCC 4.8.2 20140206 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from smtplib import SMTP
>>> SMTP('a.com', timeout=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.3/smtplib.py", line 241, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.3/smtplib.py", line 320, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.3/smtplib.py", line 291, in _get_socket
self.source_address)
File "/usr/lib/python3.3/socket.py", line 435, in create_connection
raise err
File "/usr/lib/python3.3/socket.py", line 426, in create_connection
sock.connect(sa)
socket.timeout: timed out |
|
Date |
User |
Action |
Args |
2014-03-12 22:52:34 | Chris.Clark | set | recipients:
+ Chris.Clark |
2014-03-12 22:52:34 | Chris.Clark | set | messageid: <1394664754.18.0.260499838693.issue20903@psf.upfronthosting.co.za> |
2014-03-12 22:52:34 | Chris.Clark | link | issue20903 messages |
2014-03-12 22:52:33 | Chris.Clark | create | |
|