[PATCH v2 09/10] parsemail: Convert to a management command
stephenfinucane at hotmail.com
Tue Aug 30 08:43:31 AEST 2016
On 28 Aug 21:10, Daniel Axtens wrote:
> Daniel Axtens <dja at axtens.net> writes:
> > with open(args, 'rb') as file_:
> > decoded_mail = file_.read().decode('utf-8')
> > mail = email.message_from_string(decoded_mail)
> > This is super ugly, but works in Py3. Ironically it doesn't work in Py2,
> > but it's a start. Could you include something like this in this patch
> > set? I think the parsearchive will require something similar too.
> Looks like there's message_from_bytes and message_from_binary_file in
> recent versions of 'email' - I haven't tried but I assume that would be
> better. Anyway, I'll leave it to your judgement.
This is a definite issue, but I think it's outside of the scope of this
series. Could you open a bug on the issue tracker  and we'll resolve
it in a follow-up?
> > I'm going to start collecting these "interesting" emails to make a test suite.
> > Regards,
> > Daniel
> >  https://lists.ozlabs.org/pipermail/patchwork/2016-August/003158.html
More information about the Patchwork