[ python-Bugs-951088 ] str(email) breaks message by adding newline

SourceForge.net noreply at sourceforge.net
Mon May 10 09:49:01 EDT 2004


Bugs item #951088, was opened at 2004-05-10 03:17
Message generated for change (Settings changed) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=951088&group_id=5470

Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Gerrit Holl (gerrit)
>Assigned to: Barry A. Warsaw (bwarsaw)
Summary: str(email) breaks message by adding newline

Initial Comment:
Since last nightly build, the following code breaks:

import email

message="""From gerrit at topjaklont.student.utwente.nl  Mon May 10 09:06:55 2004
Return-Path: <gerrit at topjaklont.student.utwente.nl>
X-Original-To: gerrit
Delivered-To: gerrit at topjaklont.student.utwente.nl
Received: by topjaklont.student.utwente.nl (Postfix, from userid 500)
        id 866FE1F835; Mon, 10 May 2004 09:06:55 +0200 (CEST)
To: gerrit at topjaklont.student.utwente.nl
Message-Id: <20040510070655.866FE1F835 at topjaklont.student.utwente.nl>
Date: Mon, 10 May 2004 09:06:55 +0200 (CEST)
From: gerrit at topjaklont.student.utwente.nl (Gerrit Holl)

content
"""

msg = email.message_from_string(message)
print str(msg)

The output is:
>From gerrit at topjaklont.student.utwente.nl  Mon May 10 09:06:55 2004

Return-Path: <gerrit at topjaklont.student.utwente.nl>
X-Original-To: gerrit
Delivered-To: gerrit at topjaklont.student.utwente.nl
Received: by topjaklont.student.utwente.nl (Postfix, from userid 500)
        id 866FE1F835; Mon, 10 May 2004 09:06:55 +0200 (CEST)
To: gerrit at topjaklont.student.utwente.nl
Message-Id: <20040510070655.866FE1F835 at topjaklont.student.utwente.nl>
Date: Mon, 10 May 2004 09:06:55 +0200 (CEST)
From: gerrit at topjaklont.student.utwente.nl (Gerrit Holl)

content

My mail client doesn't like this.
The test script has been attached.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=951088&group_id=5470



More information about the Python-bugs-list mailing list