Skip to contentSkip to conversation

b4 is having trouble with unicode emails

DISCUSSION Dmitry Torokhov 2 participants 5 messages Sep 22, 2022 – Sep 23, 2022

lore
Share & tools
lore
#0 lore raw

Hi Konstantin,

It looks like b4 does not like non-acsii in emails, and fails for emails like "Marek Behún <[email protected]>":

dtor@dtor-ws:~/kernel/linux-next (get_gpiod_from_child-remove)$ b4 send --no-sign --not-me-too --to='Marek Behún <[email protected]>' -o patches/gpiod-from-child Converted the branch to 4 messages
Populating To/Cc addresses
Will write out messages into patches/gpiod-from-child
Traceback (most recent call last):
File "/usr/local/google/home/dtor/b4/b4/command.py", line 358, in <module>

    cmd()
  File "/usr/local/google/home/dtor/b4/b4/command.py", line 341, in cmd
    cmdargs.func(cmdargs)
  File "/usr/local/google/home/dtor/b4/b4/command.py", line 86, in cmd_send
    b4.ez.cmd_send(cmdargs)
  File "/usr/local/google/home/dtor/b4/b4/ez.py", line 1268, in cmd_send
    msg.add_header('To', b4.format_addrs(allto))

File "/usr/local/google/home/dtor/b4/b4/__init__.py", line 2878, in format_addrs
addrs.add(email.utils.formataddr(pair)) # noqa
File "/usr/lib/python3.10/email/utils.py", line 91, in formataddr
address.encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\xfa' in position 9: ordinal not in range(128) dtor@dtor-ws:~/kernel/linux-next (get_gpiod_from_child-remove)$ b4 send --no-sign --not-me-too --to='Marek Behun <[email protected]>' -o patches/gpiod-from-child Converted the branch to 4 messages
Populating To/Cc addresses
Will write out messages into patches/gpiod-from-child
0000-get-rid-of-devm_fwnode_get_-index_-gpiod_from_child.eml 0001-devm_fwnode_get_gpiod_from_child-is-going-away-as-the-name-is-too-unwieldy-let-s-switch-to-using-the-new-devm_fwnode_gpiod_get.eml 0002-devm_fwnode_get_gpiod_from_child-is-going-away-as-the-name-is-too-unwieldy-let-s-switch-to-using-the-new-devm_fwnode_gpiod_get.eml 0003-now-that-there-are-no-more-users-of-these-apis-in-the-kernel-we-can-remove-them.eml
---
DRYRUN: Would have sent 4 messages

Thanks!

Signature · 1 line
Dmitry
#1 lore raw
Quoted 4 lines · Dmitry Torokhov

Hi Konstantin,

It looks like b4 does not like non-acsii in emails, and fails for emails like "Marek Behún <[email protected]>":

It wasn't really the unicode, we just weren't expecting to receive fully formatted addresses like that. E.g., this was fine:

    b4 send --to [email protected]

but this wasn't:

    b4 send --to 'Foo Foo <[email protected]>'

The latest master/stable-0.10.y should have handle this properly.

-K

#2 lore raw
Quoted 9 lines · Konstantin Ryabitsev
Quoted 4 lines · Dmitry Torokhov

Hi Konstantin,

It looks like b4 does not like non-acsii in emails, and fails for emails like "Marek Behún <[email protected]>":

It wasn't really the unicode, we just weren't expecting to receive fully formatted addresses like that. E.g., this was fine:

Quoted 7 lines
    b4 send --to [email protected]

but this wasn't:

    b4 send --to 'Foo Foo <[email protected]>'

The latest master/stable-0.10.y should have handle this properly.

No, if you look closely in my log there were 2 invocations, one with

--to 'Marek Behún <[email protected]>'

which dies with UnicodeEncodeError exception, while another, with

--to='Marek Behun <[email protected]>'

works properly.

This is with ToT checkout at:

6c215d8 ez: don't send a cover letter for a 1-patch series

Thanks.

Signature · 1 line
Dmitry
#3 lore raw
Quoted 11 lines · Dmitry Torokhov
Quoted 1 line

The latest master/stable-0.10.y should have handle this properly.

No, if you look closely in my log there were 2 invocations, one with

--to 'Marek Behún <[email protected]>'

which dies with UnicodeEncodeError exception, while another, with

--to='Marek Behun <[email protected]>'

works properly.

Sure, but the problem was as I described. If we properly parse the --to parameter as a header-like email address, as opposed to just expecting a bare email address there, the fix does the right thing.

-K

#4 lore raw
Quoted 9 lines · Konstantin Ryabitsev
Quoted 8 lines · Dmitry Torokhov
Quoted 1 line

The latest master/stable-0.10.y should have handle this properly.

No, if you look closely in my log there were 2 invocations, one with

--to 'Marek Behún <[email protected]>'

which dies with UnicodeEncodeError exception, while another, with

Quoted 7 lines
Quoted 3 lines

--to='Marek Behun <[email protected]>'

works properly.

Sure, but the problem was as I described. If we properly parse the --to parameter as a header-like email address, as opposed to just expecting a bare email address there, the fix does the right thing.

Ah, I understand now.

The new ToT does work for me now, thank you for fixing this.

Signature · 1 line
Dmitry