[ python-Bugs-1002475 ] email message parser doesn't handle \r\n
correctly
SourceForge.net
noreply at sourceforge.net
Tue Aug 3 10:32:51 CEST 2004
Bugs item #1002475, was opened at 2004-08-03 10:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1002475&group_id=5470
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Sjoerd Mullender (sjoerd)
Assigned to: Nobody/Anonymous (nobody)
Summary: email message parser doesn't handle \r\n correctly
Initial Comment:
Header lines that end in \r\n only get the \n stripped,
not the \r (unless it's the last header which does get
the \r stripped):
>>> import email.Parser
>>> m = 'Header: text\r\nNext-Header: more
text\r\n\r\nBody\r\n\r\n'
>>> msg = email.Parser.Parser().parsestr(m)
>>> msg.get('header')
'text\r'
>>> msg.get('next-header')
'more text'
>>>
This bug showed itself in my SpamBayes setup using
sb_imapfilter.py where base64-encoded text/html
messages were not decoded in Message.get_payload
because the call to get('content-transfer-encoding')
returned the string 'base64\r' instead of 'base64'.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1002475&group_id=5470
More information about the Python-bugs-list
mailing list