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

Rodolpho Eckhardt report at bugs.python.org
Sat Jun 21 18:51:12 CEST 2008


Rodolpho Eckhardt <rodolpho at eckhardt.com.br> added the comment:

Verified Werneck's patch and it also works on 2.6 and 3.0.

However, the previous code used to present a "friendly" message about
non-numeric ports: "socket.error: nonnumeric port" and now it raises
"ValueError: invalid literal for int() with base 10".

Should it be changed to inform that the exception is due to a
non-numeric port? (Just wrap int(port) with a try and change the raised
exception)

----------
nosy: +rodolpho
versions: +Python 2.6, Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2118>
_______________________________________


More information about the Python-bugs-list mailing list