Improve MIME header handling

Bug #266574 reported by Loewis
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Unassigned

Bug Description

This patch fixes a number of problems for non-English
archives. In particular:

- it normalizes the encoding name (converting to
lower-case, splitting of potential \r characters, and
splitting off potential quotes)

- if the article and the header encoding differ, it tries
to preserve the decoded header as a Unicode string,
instead of immediately falling back to the MIME-encoded
one (if the encoding is not known to Python it will
still fall back)

- if a Unicode string needs to be formatted, it uses
character references for all non-ASCII characters.

[http://sourceforge.net/tracker/index.php?func=detail&aid=510415&group_id=103&atid=300103]

Tags: pipermail
Revision history for this message
Loewis (loewis) wrote :
Revision history for this message
Loewis (loewis) wrote :

The second version of this patch expects and ignores
LookupError from unicode(), and it decodes the subjects from
the next and previous articles.

Revision history for this message
K-fish (k-fish) wrote :

I tried to apply this patch to mailman 2.0.8 and 2.0.9, and
both times the patch didn't apply cleanly. In fact 6 out of
10 hunks failed here. Any hints on that? For which version
was the patch created?

Revision history for this message
Loewis (loewis) wrote :

The patch applies to version 2.13 of HyperArch.py, just as
the patch header says.

It was current for the mailman CVS at the time of its
creation. It has been applied to the mailman CVS by now (as
2.14), so
it is now useless. Feel free to back-port it to mailman
2.0.8 if you want.

Revision history for this message
K-fish (k-fish) wrote :

Ok, I could have had a look at the patch header more
closely, sorry. Thanks for your answer though, I wasn't
aware of 2.14 being existent at all, since 2.0.9 seems to be
the latest version being officially avilable...

Anyway, my problem with german Umlauts being screwed up was
solved by running arch manually, somehow the Umlauts seems
to be only messed up when the archiver is run automatically...

And rather than backporting (especially now, since my
special problem was solved so easily ;) I would love to see
a newer version of mailman being released officially...

Thanks again for you answer!

Revision history for this message
Barry Warsaw (barry) wrote :

k-fish, Martin was actually referring to the revision of one
of the files in the Mailman 2.1 distribution. MM2.1 is in
beta testing now and will officially support
internationalization. The MM2.0.x does not.

I'm closing this patch since as Martin says, it's already
applied!

Revision history for this message
K-fish (k-fish) wrote :

Thanks, now this is clear. I'll try the beta ASAP :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.