Hi,

Before opening a bug report at bugs.python.org, I wish to have your
feedback on this:

When a "\r\n" is missing between the headers and the body, the
feedparser silently fix the issue. The ouput buffer is modified (the
\r\n is added, and nothing is appended to the defects list.

In my opinion, as the output buffer is modified, this is a bug.

In the attachment you'll find files.tgz which contains :
  - orig.eml : original email
  - after.eml: output of email.message_from_string
  - test.py: short test script

original email:
{{{
Received: from 127.0.0.1 ([192.168.254.1]) by IMP with bizsmtp
  id 4Z3J1h00102awG001Z3J01; Wed, 06 Jul 2011 11:03:18 +0200
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00800000
Message-ID: <[email protected]>
Date: Wed, 29 Jun 2011 14:28:04 +0800
From: test <[email protected]>
To: [email protected]
Subject: a test subject
Here's a wrong email body... \r\n are missing
}}}

email parsed by the feedparser:
{{{
Received: from 127.0.0.1 ([192.168.254.1]) by IMP with bizsmtp
  id 4Z3J1h00102awG001Z3J01; Wed, 06 Jul 2011 11:03:18 +0200
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00800000
Message-ID: <[email protected]>
Date: Wed, 29 Jun 2011 14:28:04 +0800
From: test <[email protected]>
To: [email protected]
Subject: a test subject

Here's a wrong email body... \r\n are missing
}}}

Xavier

Attachment: files.tgz
Description: application/compressed-tar

_______________________________________________
Email-SIG mailing list
[email protected]
Your options: 
http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com

Reply via email to