[PATCH v2 09/10] parsemail: Convert to a management command

Daniel Axtens 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[0], '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.
>> 
>> Regards,
>> Daniel
>
> 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 [1] and we'll resolve
> it in a follow-up?

Fair enough. Will do.

Regards,
Daniel

>
> Stephen
>
> [1] https://github.com/getpatchwork/patchwork/issues
>
>> >
>> > I'm going to start collecting these "interesting" emails to make a test suite.
>> >
>> > Regards,
>> > Daniel
>> >
>> > [0] https://lists.ozlabs.org/pipermail/patchwork/2016-August/003158.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 859 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/patchwork/attachments/20160830/b39e1b67/attachment.sig>


More information about the Patchwork mailing list