tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: tools@linux.kernel.org, users@linux.kernel.org
Subject: Re: Multi-patch series broken in b4 master
Date: Fri, 11 Jun 2021 08:37:56 -0400	[thread overview]
Message-ID: <20210611123756.zdnyugrvuf2p23hu@nitro.local> (raw)
In-Reply-To: <CAMuHMdWakx2RcL4W_cmUh8s3NYp3darGmrVu11Hq2-sY0GqUPg@mail.gmail.com>

On Fri, Jun 11, 2021 at 01:55:29PM +0200, Geert Uytterhoeven wrote:
> Hi Konstantin,
> 
> Commit c2e1aa9cbbf3d89a ("Save exploded pull requests as maildirs
> as well") broke patch series containing more than one patch, as the
> resulting .mbx file no longer has the needed separators between emails.

Oooh, I think we discovered a bug in Python that doesn't actually write the
proper "From " header when running as_string() as opposed to as_bytes().

    $ cat test.py
    #!/usr/bin/env python3
    import sys
    import email.message

    msg = email.message.EmailMessage()
    msg.set_payload('Hello World')
    msg['Subject'] = 'Hello'
    msg['From'] = 'Me <me@foo.bar>'
    print('as_string:')
    print(msg.as_string(unixfrom=True))
    print()
    print('as_bytes:')
    print(msg.as_bytes(unixfrom=True).decode())

    $ python3 test.py
    as_string:
    Subject: Hello
    From: Me <me@foo.bar>

    Hello World

    as_bytes:
    From nobody Fri Jun 11 08:34:11 2021
    Subject: Hello
    From: Me <me@foo.bar>

    Hello World

According to the docs, the output should be identical, but the "From " part is
only present in the second version, which is specifically not what the docs
say should happen:
https://docs.python.org/3/library/email.message.html#email.message.EmailMessage.as_string

I'll open a bug with Python and work around this in b4.

Thanks for the report -- I'll push out a 0.7.3 shortly.

-K

  reply	other threads:[~2021-06-11 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 11:55 Multi-patch series broken in b4 master Geert Uytterhoeven
2021-06-11 12:37 ` Konstantin Ryabitsev [this message]
2021-06-11 14:16   ` Konstantin Ryabitsev
2021-06-11 18:29     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210611123756.zdnyugrvuf2p23hu@nitro.local \
    --to=konstantin@linuxfoundation.org \
    --cc=geert@linux-m68k.org \
    --cc=tools@linux.kernel.org \
    --cc=users@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).