This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stranger4good
Recipients stranger4good
Date 2008-02-14.22:23:11
SpamBayes Score 0.20385364
Marked as misclassified No
Message-id <>
smtplib.SMTP() raises socket.error rather than SMTPConnectError

just try this on a non-responding address

>>> srv=smtplib.SMTP('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python25\lib\", line 244, in __init__
    (code, msg) = self.connect(host, port)
  File "c:\python25\lib\", line 311, in connect
    (code, msg) = self.getreply()
  File "c:\python25\lib\", line 352, in getreply
    line = self.file.readline()
  File "C:\Python25\lib\", line 346, in readline
    data = self._sock.recv(self._rbufsize)
socket.error: (10054, 'Connection reset by peer')
Date User Action Args
2008-02-14 22:23:13stranger4goodsetspambayes_score: 0.203854 -> 0.20385364
recipients: + stranger4good
2008-02-14 22:23:13stranger4goodsetspambayes_score: 0.203854 -> 0.203854
messageid: <>
2008-02-14 22:23:12stranger4goodlinkissue2118 messages
2008-02-14 22:23:11stranger4goodcreate