[Python-checkins] python/dist/src/Lib smtplib.py,1.46.4.3,1.46.4.4

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
2002年10月05日 20:37:02 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv24395
Modified Files:
 Tag: release22-maint
	smtplib.py 
Log Message:
Backport 1.60 and 1.62:
Patch #586999: Fix multiline string in sendmail example.
smptlib did not handle empty addresses.
The problem was that it expected rfc822.parseaddr() to return None
upon a parse failure. The actual, documented return value for a
parse failure is (None, None).
Closes SF bug 602029.
Index: smtplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v
retrieving revision 1.46.4.3
retrieving revision 1.46.4.4
diff -C2 -d -r1.46.4.3 -r1.46.4.4
*** smtplib.py	2 Jun 2002 12:32:04 -0000	1.46.4.3
--- smtplib.py	6 Oct 2002 03:37:00 -0000	1.46.4.4
***************
*** 167,178 ****
 Should be able to handle anything rfc822.parseaddr can handle.
 """
! m=None
 try:
 m=rfc822.parseaddr(addr)[1]
 except AttributeError:
 pass
! if not m:
 #something weird here.. punt -ddm
! return addr
 else:
 return "<%s>" % m
--- 167,178 ----
 Should be able to handle anything rfc822.parseaddr can handle.
 """
! m = (None, None)
 try:
 m=rfc822.parseaddr(addr)[1]
 except AttributeError:
 pass
! if m == (None, None): # Indicates parse failure or AttributeError
 #something weird here.. punt -ddm
! return "<%s>" % addr
 else:
 return "<%s>" % m
***************
*** 605,609 ****
 >>> s=smtplib.SMTP("localhost")
 >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
! >>> msg = '''
 ... From: Me@my.org
 ... Subject: testin'...
--- 605,609 ----
 >>> s=smtplib.SMTP("localhost")
 >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
! >>> msg = '''\\
 ... From: Me@my.org
 ... Subject: testin'...

AltStyle によって変換されたページ (->オリジナル) /