This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Header loses lines, formats strangely
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, mbrierst
Priority: normal Keywords:

Created on 2003-02-03 21:36 by mbrierst, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (2)
msg14409 - (view) Author: Michael Stone (mbrierst) Date: 2003-02-03 21:36
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.
msg14410 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2003-03-03 23:50
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.
History
Date User Action Args
2022-04-10 16:06:29adminsetgithub: 37900
2003-02-03 21:36:10mbrierstcreate