[PATCH v2 09/10] parsemail: Convert to a management command
dja at axtens.net
Tue Aug 30 10:53:21 AEST 2016
Stephen Finucane <stephenfinucane at hotmail.com> writes:
> 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?
Fair enough. Will do.
>  https://github.com/getpatchwork/patchwork/issues
>> > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 859 bytes
Desc: not available
More information about the Patchwork