diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-06-09 15:05:57 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-06-09 15:05:57 -0400 |
commit | 0f663d07e669c39ce9a7ddfa71ed1293379a358e (patch) | |
tree | 10a53c305cd4812929a1519ae61e7aaa12798ff7 /Lib/test | |
parent | 8168d10ea683d939ae52a1ed3d7c697c92bfae3d (diff) | |
download | cpython-git-0f663d07e669c39ce9a7ddfa71ed1293379a358e.tar.gz |
#12283: Fixed regression in smtplib quoting of leading dots in DATA.
I unfortunately introduced the regression when I refactored the code,
and there were no tests of quoting so it wasn't caught. Now there
is one.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_smtplib.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 884529f542..dd920447ad 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -278,6 +278,21 @@ class DebuggingServerTests(unittest.TestCase): mexpect = '%s%s\n%s' % (MSG_BEGIN, m.decode('ascii'), MSG_END) self.assertEqual(self.output.getvalue(), mexpect) + def testSendNeedingDotQuote(self): + # Issue 12283 + m = '.A test\n.mes.sage.' + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) + smtp.sendmail('John', 'Sally', m) + # XXX (see comment in testSend) + time.sleep(0.01) + smtp.quit() + + self.client_evt.set() + self.serv_evt.wait() + self.output.flush() + mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END) + self.assertEqual(self.output.getvalue(), mexpect) + def testSendMessage(self): m = email.mime.text.MIMEText('A test message') smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3) |