Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 263370 - elog mail headers folded using tabulator instead of space
Summary: elog mail headers folded using tabulator instead of space
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Portage team
URL: http://bugs.python.org/issue1974
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 210077 268228
  Show dependency tree
 
Reported: 2009-03-22 15:04 UTC by Martin von Gagern
Modified: 2009-05-02 02:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Use Header object (bug263370a.patch,862 bytes, patch)
2009-03-31 09:13 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2009-03-22 15:04:54 UTC
I'm using the elog mail interface. Even though my subject setting is at its default from make.globals, i.e.
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
the subjects get displayed on my system with a tabulator character instead of a space after the word "on".

In past versions of Thunderbird, this has caused a somewhat larger space, but recently a dotted box containing the letters "HT" for "horizontal tab" is shown instead, further reducing the legibility of those lines.

Looking at the source of a mail in question, I find the SUbject line has been folded at that position, replacing " " by "\n\t" or even "\r\n\t". According to http://tools.ietf.org/html/rfc5322#section-2.2.3 unfolding only removes CRLF pairs, and doesn't change the whitespace itself in any way, so this seems to be proper behaviour on the part of Thunderbird.

I would assume that the cause of this problem is the continuation_ws='\t' hardcoded into email.Generator._write_headers in email/generator.py of Python 2.5. Probably http://bugs.python.org/issue1974 is about just this issue. My experience is that mail related python bugs take a long time to fix upstream. The remotely related http://bugs.python.org/issue1670765 for example is open for two years now despite it being a patch submission, not only a bug report.

So if you see any real chance at getting this included into python, either upstream or at the distro level, fixing that part of python might be a solution. If not, you should probably work around that broken lib somehow.
Comment 1 Martin von Gagern 2009-03-31 06:01:38 UTC
Update: http://bugs.python.org/msg84698
Python upstream has addressed this for 2.7, but won't backport the fix.
Comment 2 Martin von Gagern 2009-03-31 09:13:39 UTC
Created attachment 186855 [details, diff]
Use Header object

http://bugs.python.org/msg84755 provides a simple workaround by using a header object instead of a simple string for the subject. This uses spaces instead of tabs, solving the issue unless the subject actually contains tabs, which I consider pretty rare. Tested the attached patch, works here, please include.
Comment 3 Zac Medico gentoo-dev 2009-03-31 16:50:20 UTC
Thanks, your patch is in svn r13261.
Comment 4 Zac Medico gentoo-dev 2009-04-11 04:26:23 UTC
This is fixed in 2.2_rc29.
Comment 5 MaratIK 2009-04-21 13:06:05 UTC
What about to close this bug?
Comment 6 Zac Medico gentoo-dev 2009-04-21 16:10:33 UTC
Since portage-2.2_rc* is masked, I'll close this after it's in an unmasked release.
Comment 7 Zac Medico gentoo-dev 2009-05-02 02:39:45 UTC
This is fixed in 2.1.6.12.