[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

Pedro Werneck report at bugs.python.org
Sat Feb 23 16:23:14 CET 2008


Pedro Werneck added the comment:

It seems the right thing to do would be to have it raise a base
exception, but SMTPConnectError docstring states "Error during
connection establishment.", so I chosen to use it with the errno and
message from socket.error, even if it's supposed to happen only after
connection is already stablished, since it's a subclass of
SMTPResponseException.

As a bonus I removed a explicit raise socket.error from line 290, when
an user pass a non-integer port.

----------
nosy: +werneck
Added file: http://bugs.python.org/file9499/issue_2118_smtplib.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2118>
__________________________________


More information about the Python-bugs-list mailing list