tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* Crash generating a thanks
@ 2021-10-29 21:03 Mark Brown
  2021-11-01 16:00 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2021-10-29 21:03 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Hi,

Attempting to generate a thanks with current tip:

750286a7aba7dc091b4407c9f31157129aade588 ty: fix bugs introduced when switching -s to -t

I get a traceback on one particular patch:

Sending: Re: [PATCH] sound: soc: tlv320aic3x: Make aic3x_remove() return void
Traceback (most recent call last):
  File "/home/broonie/git/b4/b4/command.py", line 287, in <module>
    cmd()
  File "/home/broonie/git/b4/b4/command.py", line 270, in cmd
    cmdargs.func(cmdargs)
  File "/home/broonie/git/b4/b4/command.py", line 96, in cmd_ty
    b4.ty.main(cmdargs)
  File "/home/broonie/git/b4/b4/ty.py", line 661, in main
    auto_thankanator(cmdargs)
  File "/home/broonie/git/b4/b4/ty.py", line 377, in auto_thankanator
    send_messages(applied, wantbranch, cmdargs)
  File "/home/broonie/git/b4/b4/ty.py", line 443, in send_messages
    smtp.sendmail(fromaddr, sendto, msg.as_string(policy=mypolicy))  # noqa
  File "/usr/lib/python3.9/smtplib.py", line 859, in sendmail
    msg = _fix_eols(msg).encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 55: ordinal not in range(128)

which is:

	https://lore.kernel.org/r/20211019074125.3812513-1-u.kleine-koenig@pengutronix.de

AFAICT.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Crash generating a thanks
  2021-10-29 21:03 Crash generating a thanks Mark Brown
@ 2021-11-01 16:00 ` Konstantin Ryabitsev
  2021-11-02 18:31   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ryabitsev @ 2021-11-01 16:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: tools

On Fri, Oct 29, 2021 at 10:03:16PM +0100, Mark Brown wrote:
> Hi,
> 
> Attempting to generate a thanks with current tip:
> 
> 750286a7aba7dc091b4407c9f31157129aade588 ty: fix bugs introduced when switching -s to -t
> 
> I get a traceback on one particular patch:
> 
> Sending: Re: [PATCH] sound: soc: tlv320aic3x: Make aic3x_remove() return void
> Traceback (most recent call last):
>   File "/home/broonie/git/b4/b4/command.py", line 287, in <module>
>     cmd()
>   File "/home/broonie/git/b4/b4/command.py", line 270, in cmd
>     cmdargs.func(cmdargs)
>   File "/home/broonie/git/b4/b4/command.py", line 96, in cmd_ty
>     b4.ty.main(cmdargs)
>   File "/home/broonie/git/b4/b4/ty.py", line 661, in main
>     auto_thankanator(cmdargs)
>   File "/home/broonie/git/b4/b4/ty.py", line 377, in auto_thankanator
>     send_messages(applied, wantbranch, cmdargs)
>   File "/home/broonie/git/b4/b4/ty.py", line 443, in send_messages
>     smtp.sendmail(fromaddr, sendto, msg.as_string(policy=mypolicy))  # noqa
>   File "/usr/lib/python3.9/smtplib.py", line 859, in sendmail
>     msg = _fix_eols(msg).encode('ascii')
> UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 55: ordinal not in range(128)

Thanks for the report. I think either I misunderstand the SMTP RFCs, or the
writers of Python's smtplib don't properly understand the difference between
the 8BITMIME and SMTPUTF8 capabilities. If the server reports 8BITMIME support
(and they all do, it's not the 90s any more), then anything following DATA
can contain 8bit content -- whether it's in the headers or the body of the
message.

Only when the email addresses themselves contain non-ascii characters AND when
they are used as either part of MAIL FROM or RCPT TO do we have to worry about
SMTPUTF8.

E.g. this doesn't require SMTPUTF8:

    MAIL FROM: <me@example.org>
    RCPT TO: <you@example.org>
    DATA
    From: Mé <me@example.org>
    To: Yôu <you@example.org>

    Hello world.
    .

Only this does:

    MAIL FROM: <mé@example.org>
    RCPT TO: <yôu@example.org>
    DATA
    From: Mé <mé@example.org>
    To: Yôu <yôu@example.org>

    Hello world.
    .

And yet, in certain situations smtplib seems to want to force-convert
everything to ascii even when you specifically tell it to not do that. It's
entirely possible that they are right and I'm wrong here, but my hands-on
testing with a couple of SMTP servers thus far haven't disabused me of this
understanding of the RFC and what 8BITMIME means.

Anyway, I think I have the fix in master that doesn't trigger this problem.
Please try it out and let me know if you see any more problems.

-K

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Crash generating a thanks
  2021-11-01 16:00 ` Konstantin Ryabitsev
@ 2021-11-02 18:31   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-11-02 18:31 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: tools

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

On Mon, Nov 01, 2021 at 12:00:32PM -0400, Konstantin Ryabitsev wrote:

> Anyway, I think I have the fix in master that doesn't trigger this problem.
> Please try it out and let me know if you see any more problems.

That seems to resolve things, thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-02 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 21:03 Crash generating a thanks Mark Brown
2021-11-01 16:00 ` Konstantin Ryabitsev
2021-11-02 18:31   ` Mark Brown

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).