summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-04-21 16:52:20 (GMT)
committerGuido van Rossum <guido@python.org>1999-04-21 16:52:20 (GMT)
commit20c92283ab670079096377775fbd997efcd1d84a (patch)
tree139f596344a23d41d5a837c2b2f4f194f89305a0 /Lib
parent4747f7f61dea2cd217f81b78fd423991495730fc (diff)
downloadcpython-20c92283ab670079096377775fbd997efcd1d84a.zip
cpython-20c92283ab670079096377775fbd997efcd1d84a.tar.gz
cpython-20c92283ab670079096377775fbd997efcd1d84a.tar.bz2
Patch by Per Cederqvist, seemingly approved by The Dragon:
Two problems: The SMTPRecipientsRefused class should not inherit SMTPResponseException, since it doesn't provide the smtp_code and smtp_error attributes. My patch for not adding an extra CRLF was apparently forgotten. The enclosed patch fixes these two problems.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/smtplib.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 0f202da..370182e 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -86,7 +86,7 @@ class SMTPSenderRefused(SMTPResponseException):
self.sender = sender
self.args = (code, msg, sender)
-class SMTPRecipientsRefused(SMTPResponseException):
+class SMTPRecipientsRefused(SMTPException):
"""All recipient addresses refused.
The errors for each recipient are accessable thru the attribute
'recipients', which is a dictionary of exactly the same sort as
@@ -371,8 +371,11 @@ class SMTP:
if code <> 354:
raise SMTPDataError(code,repl)
else:
- self.send(quotedata(msg))
- self.send("%s.%s" % (CRLF, CRLF))
+ q = quotedata(msg)
+ if q[-2:] != CRLF:
+ q = q + CRLF
+ q = q + "." + CRLF
+ self.send(q)
(code,msg)=self.getreply()
if self.debuglevel >0 : print "data:", (code,msg)
return (code,msg)