--- Lib/email/test/otest_email.py 2008-01-19 07:32:27.000000000 -0500 +++ Lib/email/test/test_email.py 2009-03-31 00:02:14.000000000 -0400 @@ -2550,6 +2550,28 @@ eq(headers, ['A', 'B', 'CC']) eq(msg.get_payload(), 'body') + def test_CRLFLF(self): + '''GAN 30Mar09 feedparser should not eat two chars from a body part + ending with "\r\n\n". The old matcher used $ where it should have + used \Z. An inline message with all invisibles explicit is used + to avoid confusion. + ''' + m = ( + "From: foo@bar.com\n" + "To: baz\n" + "Mime-Version: 1.0\n" + "Content-Type: multipart/mixed; boundary=BOUNDARY\n" + "\n" + "--BOUNDARY\n" + "Content-Type: text/plain\n" + "\n" + "body ending with CRLF newline\r\n" + "\n" + "--BOUNDARY--\n" + ) + msg = email.message_from_string(m) + self.assertTrue(msg.get_payload(0).get_payload().endswith('\r\n')) + class TestBase64(unittest.TestCase):