All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Konstantin Ryabitsev" <konstantin@linuxfoundation.org>
To: Mark Brown <broonie@kernel.org>
Cc: tools@linux.kernel.org
Subject: Re: b4 ty unicode crash
Date: Mon, 28 Dec 2020 11:56:27 -0500	[thread overview]
Message-ID: <20201228165627.7r2zd2gzvo4kuhsg@chatter.i7.local> (raw)
In-Reply-To: <20201228161347.GD5352@sirena.org.uk>

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

On Mon, Dec 28, 2020 at 04:13:47PM +0000, Mark Brown wrote:
> Hi,
> 
> When I run b4 ty and it finds what looks like:
> 
>    https://lore.kernel.org/r/ec66399502514edbb1de3cf9bff08b1d@realtek.com
> 
> I get a traceback:

Urgh, this uncovered a bug in Python:

In [5]: from email import utils

In [6]: utils.getaddresses(['foo <foo@bar.com>'])
Out[6]: [('foo', 'foo@bar.com')]

In [7]: utils.getaddresses(['Shuming [范書銘] <shumingf@realtek.com>'])
Out[7]:
[('', 'Shuming'),
 ('', ''),
 ('', '范書銘'),
 ('', ''),
 ('', 'shumingf@realtek.com')]

It crashes when it tries to treat "范書銘" as an email address.

>   File "/usr/lib/python3.7/email/utils.py", line 91, in formataddr
>     address.encode('ascii')
> UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-24: ordinal not in range(128)

I'm not sure how to tackle this yet, but I'll try to figure it out.

Thanks for the report.

-K

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

  reply	other threads:[~2020-12-28 16:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 16:13 b4 ty unicode crash Mark Brown
2020-12-28 16:56 ` Konstantin Ryabitsev [this message]
2020-12-28 18:18 ` Konstantin Ryabitsev
2020-12-29 12:16   ` [tools] " Mark Brown

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=20201228165627.7r2zd2gzvo4kuhsg@chatter.i7.local \
    --to=konstantin@linuxfoundation.org \
    --cc=broonie@kernel.org \
    --cc=tools@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.