Re: Further UTF8/MIME fixes for the commitfest app

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: PostgreSQL WWW list <pgsql-www(at)postgresql(dot)org>
Subject: Re: Further UTF8/MIME fixes for the commitfest app
Date: 2017-03-19 13:45:54
Message-ID: CABUevEwjMkdeQWG9P8EKEOXd+xjhXZJwpQPzNHjexnTv3jLpRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Tue, Mar 14, 2017 at 2:07 PM, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org
> wrote:

> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>
> > On Wed, Mar 1, 2017 at 5:35 PM, Dagfinn Ilmari Mannsåker <
> ilmari(at)ilmari(dot)org>
> > wrote:
> […]
> >> #2 MIME-decodes headers received from the mailing list archive JSON API
> >>
> >> I haven't been able to talk to the JSON api, so I couldn't test them
> >> properly, but I did some stand-alone testing of the code snippets.
> >>
> >> Note that the MIME decoding only works properly if running under Python
> >> 3; the Python 2 version of email.header.decode_header() has broken
> >> detection of the end of encoded-words.
> >
> > Is the patch still an improvement on python2?
>
> No, because it'd be affected by the same problem that causes the
> undecoded headers to be returned from the archive app.
>

OK.

> > Also, based on your other email about the list archives -- if we fix this
> > in the archives, does that make this patch unnecessary?
>
> Yes, this patch is unnecessary if the archive app is fixed, and
> insufficient if the commitfest app isn't upgraded to python3.
>
> One possible workaround until upgrading to python3 is feasible would be
> for the archive app to do some more munging (akin to the existing
> _re_mailworkaround), and inject a space between an encoded-word and an
> immediately-adjacent opening/closing paren.
>

Actually, if I read that one right, it would be enough to upgrade the
*loader* part of the archives, which is a much more contained problem, as
it pretty much only has dependencies on the standard library.

Will have to run some detailed tests on that of course, to make sure it
doesn't break anything else (like we have to reparse the 1.2 million
messages in the archives and see if something else changes - but we have
tools for this), but I think that's probably the best way forward from here.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Alexey Vasiliev 2017-03-19 23:29:44 Update book to new version
Previous Message Andrew Dunstan 2017-03-14 16:30:12 Re: buildfarm git references pointing at github?