mricon / b4

Tool to help with email-based patch workflows
GNU General Public License v2.0
59 stars 20 forks source link

b4 am splat #6

Closed morbidrsa closed 1 year ago

morbidrsa commented 1 year ago

When grabbing a patches from a specific contributor I always get a splat similar to this:

[johannes@redsun91:~]$ b4 am -s -l
[20230616113732.83210-1-josejavier.rodriguez@duagon.com](mailto:20230616113732.83210-1-josejavier.rodriguez@duagon.com)
Analyzing 2 messages in the thread
Checking attestation on all messages, may take a moment...
---
  ✓ [PATCH 1/1] mcb: Do not add the mcb_bus_type to the mcb_bus itself
    + Link: https://lore.kernel.org/r/20230616113732.83210-2-josejavier.rodriguez@duagon.com
    + Signed-off-by: Johannes Thumshirn <[johannes.thumshirn@wdc.com](mailto:johannes.thumshirn@wdc.com)>
  ---
  ✓ Signed: DKIM/[duagon.com](http://duagon.com/)
---
Total patches: 1
---
Traceback (most recent call last):
  File "/usr/local/bin/b4", line 8, in <module>
    sys.exit(cmd())
             ^^^^^
  File "/usr/lib/python3.11/site-packages/b4/command.py", line 360, in cmd
    cmdargs.func(cmdargs)
  File "/usr/lib/python3.11/site-packages/b4/command.py", line 91, in cmd_am
    b4.mbox.main(cmdargs)
  File "/usr/lib/python3.11/site-packages/b4/mbox.py", line 706, in main
    make_am(msgs, cmdargs, msgid)
  File "/usr/lib/python3.11/site-packages/b4/mbox.py", line 197, in make_am
    b4.save_git_am_mbox(am_msgs, fh)
  File "/usr/lib/python3.11/site-packages/b4/__init__.py", line 3088,
in save_git_am_mbox
    dest.write(LoreMessage.get_msg_as_bytes(msg, headers='decode'))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/b4/__init__.py", line 1511,
in get_msg_as_bytes
    bdata += LoreMessage.wrap_header((hname, str(hval)), nl=nl,
transform=headers) + nl.encode()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/b4/__init__.py", line 1459,
in wrap_header
    qp = format_addrs([addr], clean=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/b4/__init__.py", line 2990,
in format_addrs
    addrs.append(email.utils.formataddr(pair))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/email/utils.py", line 91, in formataddr
    address.encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\xed' in
position 4: ordinal not in range(128)

The b4 version is 0.12.2.

Is that a known issue, or did I supply some options incorrectly?

mricon commented 1 year ago

There is a fix for this in the current 0.12.y. Please update to 0.12.3 when it's released later today.