[Python-bugs-list] [ python-Bugs-601392 ] weird header wrapping in email.Generator

noreply@sourceforge.net noreply@sourceforge.net
Tue, 10 Sep 2002 08:56:16 -0700


Bugs item #601392, was opened at 2002-08-28 12:14
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=601392&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
>Resolution: Fixed
Priority: 5
Submitted By: Greg Ward (gward)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: weird header wrapping in email.Generator

Initial Comment:
I have discovered a particular header line that 
email.Generator does not wrap very well.  Here it is, 
mangled by my web browser and SF:

Received: from 
modemcable093.139-201-24.que.mc.videotron.ca 
([24.201.139.93] helo=cthulhu.gerg.ca)
        by kronos.mems-exchange.org with esmtp (Exim 
4.05)
        id 17k4h5-00034i-00
        for test@mems-exchange.org; Wed, 28 Aug 2002 
11:25:20 -0400

(Only one line, the first, is particularly long.  The other 
three lines all fit comfortably in 78 columns.)

(Oh, I'll try to attach a message consisting solely of this 
header line along with my test script.)

With Python 2.2.1, email.Message.as_string() wraps this 
header line as:

Received: from 
modemcable093.139-201-24.que.mc.videotron.ca 
([24.201.139.93]
        helo=cthulhu.gerg.ca)
        by kronos.mems-exchange.org with esmtp (Exim 
4.05)
        id
        17k4h5-00034i-00
        for test@mems-exchange.org; Wed, 28 Aug 2002 
11:25:20 -0400

(The oddity there is the word "id" alone on a line.)

With CVS Python (as of 10 minutes ago), it's wrapped as:

Received: from 
modemcable093.139-201-24.que.mc.videotron.ca 
([24.201.139.93]
        helo=cthulhu.gerg.ca)
        by kronos.mems-exchange.org with esmtp (Exim 
4.05)id 17k4h5-00034i-00
        for test@mems-exchange.org; Wed, 28 Aug 2002 
11:25:20 -0400

(Note how "id ..." is jammed right up against "(Exim 
4.05)".)



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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2002-09-10 11:56

Message:
Logged In: YES 
user_id=12800

It looks like a really simple patch to Header.py fixes this,
and causes no regressions in the test suite.  That's good
enough for me, but I have some vague worries that it could
cause breakage.  This will be committed to Header.py 1.11

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

Comment By: Skip Montanaro (montanaro)
Date: 2002-08-29 12:26

Message:
Logged In: YES 
user_id=44345

I believe this is a duplicate of the bug report I filed:

    http://python.org/sf/594893

One or the other should probably be closed.


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

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2002-08-28 12:28

Message:
Logged In: YES 
user_id=12800

Verified.  Here's a one-file example that illustrates the bug.

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

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