Message 110631 - Python tracker (original) (raw)

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?