[Python-bugs-list] [ python-Bugs-679827 ] Header loses lines, formats strangely

SourceForge.net noreply@sourceforge.net
Mon, 03 Mar 2003 15:50:45 -0800


Bugs item #679827, was opened at 2003-02-03 16:36
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=679827&group_id=5470

Category: None
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: Michael Stone (mbrierst)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Header loses lines, formats strangely

Initial Comment:

Biggest problem:
print email.message_from_string("""header: problems
\tthis line is lost
\tthis is not""")

This was caused by revision 1.11 of Header.py which was in response to bug #601392.  The bugs notes show that when this change was checked in, side effects were worried about, and this is it.

Besides this problem, Header does strange and inconsistent formatting of header strings when breaking lines.  Tabs are not consistently taken to be 8 spaces when splitting lines (sometimes they are, sometimes not), and a different module (quopriMIME) handles UN-breaking lines (in the _max_append routine) causing strange formatting.

quopriMIME doesn't deal with the max line length quite correctly and in header_encode ignores leading spaces when calculating line length (maybe this is on purpose?)

All of these issues probably relate somewhat to the discussion in bug #594893 about how to deal with header lines.  Some of this may be related to bug #675420 as well.

I have worked a bit on a patch, and could finish it if someone wants to see it, but I would have to ask some questions about how lines should be broken and unbroken (how to deal with whitespace and such) first.

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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-03-03 18:50

Message:
Logged In: YES 
user_id=12800

I think this specific problem (labeled "biggest problem"
above) is fixed in the folding-reimpl-branch, which will
soon be merged to email 2.5 on the python 2.3 trunk (and
likely backported to python 2.2.3).

Both bugs 594893 and 675420 are still open so I will respond
to those on those bug reports.

As for the other problems alluded to in this report, please
submit separate bug reports for them, and assign them to me.
 Be sure to upload (not paste as a comment) sample code that
illustrates the bug.  If the bugs still exist, I will want
to add them to the test suite.

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

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