Author belopolsky
Recipients belopolsky, tarek
Date 2009-01-19.21:21:56
SpamBayes Score 7.58708e-10
Marked as misclassified No
Message-id <>
In-reply-to <>
On Mon, Jan 19, 2009 at 2:01 PM, Tarek Ziadé <> wrote:
> Tarek Ziadé <> added the comment:
>> What is the rationale for swallowing all socket exceptions except
>> "Connection reset by peer" in __exit__?
> I am catching just the error that raises if the connection is closed
> when calling quit()

I see. I misread the double negative "except errno NOT equals 54", but
I still don't see the rationale for that exception.  I any case, I
don't think your patch implements that because SMTP transforms socket
errors into SMTPServer* errors in send():

        if self.sock:
            except socket.error:
                raise SMTPServerDisconnected('Server not connected')
            raise SMTPServerDisconnected('please run connect() first')

so you will never see a socket error from quit().

Furthermore, I don't think you should ignore return code from quit():
you should raise an error if it returns anything but 221.
Date User Action Args
2009-01-19 21:21:58belopolskysetrecipients: + belopolsky, tarek
2009-01-19 21:21:57belopolskylinkissue4972 messages
2009-01-19 21:21:56belopolskycreate