MIMEMultipart() and CRLF vs RFC 2046

A

alf

Hi,

according to rfc2046, line breaks in MIME are CRLF. However python just
uses LF like in the following example:


from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText

msg = MIMEMultipart()
msg['Subject'] = 'Our family reunion'
msg['From'] = '(e-mail address removed)'
msg['To'] = '(e-mail address removed)'
msg.epilogue = ''

msg.attach(MIMEText('aaaaaaaaaaaaaaaaaaaaaaaa'))

print `msg.as_string()`


gives:
'Content-Type: multipart/mixed;
boundary="===============1018679223=="\nMIME-Version: 1.0\nSubject: Our
family reunion\nFrom: (e-mail address removed)\nTo:
(e-mail address removed)\n\n--===============1018679223==\nContent-Type: text/plain;
charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding:
7bit\n\naaaaaaaaaaaaaaaaaaaaaaaa\n--===============1018679223==--\n'



Any insight why does it not stick to standard. I also checked parsing
and it seems to accept both CRLF and LF.
 
G

Gabriel Genellina

according to rfc2046, line breaks in MIME are CRLF. However python just
uses LF like in the following example:

The comments inside generator.py say CRLF everywhere, but the code
simply uses print >>f
You should file a bug report at http://sourceforge.net/tracker/?group_id=5470


Gabriel Genellina
Softlab SRL





__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top