Message80210
On Mon, Jan 19, 2009 at 2:01 PM, Tarek Ziadé <report@bugs.python.org> wrote:
>
> Tarek Ziadé <ziade.tarek@gmail.com> 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:
try:
self.sock.sendall(str)
except socket.error:
self.close()
raise SMTPServerDisconnected('Server not connected')
else:
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:58 | belopolsky | set | recipients:
+ belopolsky, tarek |
2009-01-19 21:21:57 | belopolsky | link | issue4972 messages |
2009-01-19 21:21:56 | belopolsky | create | |
|