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

Mark Lawrence report at bugs.python.org
Sun Jul 18 13:09:47 CEST 2010


Mark Lawrence <breamoreboy at yahoo.co.uk> added the comment:

I applied the patch to test_smtplib.py only and all tests passed, surely that's not correct.

Removing the explicit test for a non-numeric port in smtplib.py seems strange to me, could someone please explain the rationale behind this.

I also noticed this line in the patch.

if self.debuglevel > 0: print>>stderr, "connect:", msg

And this comment in set_debuglevel in smtplib.py

"A non-false value results in debug messages for connection and for all
messages sent to and received from the server."

IIRC if a string was passed into set_debuglevel the comparison would fail in py3k, am I correct?  The print statement would not work in py3k.
Given that the debuglevel code obviously doesn't get tested perhaps it should simply be stripped from the code?

----------
nosy: +BreamoreBoy

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


More information about the Python-bugs-list mailing list