[Python-checkins] CVS: python/dist/src/Lib smtplib.py,1.45,1.46

Barry Warsaw bwarsaw@users.sourceforge.net
Fri, 14 Dec 2001 12:34:22 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv14486

Modified Files:
	smtplib.py 
Log Message:
send(), ehlo(): Integrate patch #487310 by Fazal Majid.  Consistently
call self.close() just before raising SMTPServerDisconnected.  This
allows you to, e.g. reconnect after a server timeout.

Merged from the 2.2c1 branch.



Index: smtplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** smtplib.py	2001/10/13 18:35:32	1.45
--- smtplib.py	2001/12/14 20:34:20	1.46
***************
*** 295,298 ****
--- 295,299 ----
                      sendptr = sendptr + self.sock.send(str[sendptr:])
              except socket.error:
+                 self.close()
                  raise SMTPServerDisconnected('Server not connected')
          else:
***************
*** 381,384 ****
--- 382,386 ----
          # that happens -ddm
          if code == -1 and len(msg) == 0:
+             self.close()
              raise SMTPServerDisconnected("Server not connected")
          self.ehlo_resp=msg