* b4 prep and --manual-reroll
@ 2022-11-04 5:00 Dmitry Torokhov
2022-11-04 17:13 ` Konstantin Ryabitsev
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2022-11-04 5:00 UTC (permalink / raw
To: Konstantin Ryabitsev; +Cc: tools, users
Hi Konstantin,
Somehow "b4 send -o dir" followed by "git send-email ..." managed to
produce quoted-printable cover letter message (see
https://lore.kernel.org/all/20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com/)
and that confused "b4 prep --manual-reroll ..." as this produced a tag
that had "=0D" as line ends. I was able to work around it with the
patch below (not sure if this is right thing to do)...
Also, doing "b4 send --resend" with this series did produce double
signature on the cover letter, even though I see in the code it tries to
remove it.
Thanks.
--
Dmitry
diff --git a/b4/ez.py b/b4/ez.py
index 4fcc988..8fb39d2 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1350,7 +1350,7 @@ def get_sent_tagname(branch: str, tagprefix: str, revstr: Union[str, int]) -> Tu
def reroll(mybranch: str, cover_msg: email.message.Message, tagprefix: str = SENT_TAG_PREFIX):
# Prepare annotated tag body from the cover letter
lsubject = b4.LoreSubject(cover_msg.get('subject'))
- cbody = cover_msg.get_payload()
+ cbody = cover_msg.get_payload(decode=True).decode()
# Remove signature
chunks = cbody.rsplit('\n-- \n')
if len(chunks) > 1:
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: b4 prep and --manual-reroll
2022-11-04 5:00 b4 prep and --manual-reroll Dmitry Torokhov
@ 2022-11-04 17:13 ` Konstantin Ryabitsev
2022-11-04 17:47 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ryabitsev @ 2022-11-04 17:13 UTC (permalink / raw
To: Dmitry Torokhov; +Cc: tools, users
On Thu, Nov 03, 2022 at 10:00:07PM -0700, Dmitry Torokhov wrote:
> Hi Konstantin,
>
> Somehow "b4 send -o dir" followed by "git send-email ..." managed to
> produce quoted-printable cover letter message (see
> https://lore.kernel.org/all/20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com/)
> and that confused "b4 prep --manual-reroll ..." as this produced a tag
> that had "=0D" as line ends. I was able to work around it with the
> patch below (not sure if this is right thing to do)...
Ah, yes, quoted-printable is the bane of my existence. Thank you for reporting
this. I think a better way forward is to get away from get_payload(), which is
a legacy method that I kept around when we cared about python3.6
compatibility. I'll comb the codebase for a better solution.
> Also, doing "b4 send --resend" with this series did produce double
> signature on the cover letter, even though I see in the code it tries to
> remove it.
I'll poke at it -- thanks for testing that out. I'm pretty sure you're the
first person to actually use it. :)
-K
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: b4 prep and --manual-reroll
2022-11-04 17:13 ` Konstantin Ryabitsev
@ 2022-11-04 17:47 ` Rob Herring
0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2022-11-04 17:47 UTC (permalink / raw
To: Konstantin Ryabitsev; +Cc: Dmitry Torokhov, tools, users
On Fri, Nov 4, 2022 at 12:14 PM Konstantin Ryabitsev
<konstantin@linuxfoundation.org> wrote:
>
> On Thu, Nov 03, 2022 at 10:00:07PM -0700, Dmitry Torokhov wrote:
> > Hi Konstantin,
> >
> > Somehow "b4 send -o dir" followed by "git send-email ..." managed to
> > produce quoted-printable cover letter message (see
> > https://lore.kernel.org/all/20221103-omapfb-gpiod-v1-0-c3d53ca7988f@gmail.com/)
> > and that confused "b4 prep --manual-reroll ..." as this produced a tag
> > that had "=0D" as line ends. I was able to work around it with the
> > patch below (not sure if this is right thing to do)...
>
> Ah, yes, quoted-printable is the bane of my existence. Thank you for reporting
> this. I think a better way forward is to get away from get_payload(), which is
> a legacy method that I kept around when we cared about python3.6
> compatibility. I'll comb the codebase for a better solution.
FWIW, this is what I use:
body = orig_msg.get_body(preferencelist='plain').get_content(errors='strict')
For sending replies, python prefers base64 if any encoding is needed,
so I do this:
msg = email.message.EmailMessage(policy=email.policy.default)
charset = orig_msg.get_content_charset()
if charset:
msg.set_content(body, charset=charset, cte='8bit')
else:
msg.set_content(body, charset='ascii', cte='7bit')
Rob
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-04 17:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 5:00 b4 prep and --manual-reroll Dmitry Torokhov
2022-11-04 17:13 ` Konstantin Ryabitsev
2022-11-04 17:47 ` Rob Herring
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 read-only IMAP folder(s) and NNTP newsgroup(s).