Exception from b4 ty
Hi,
Attempting to generate thanks with b4 ty -a using current git master I get a traceback:
Found 41 of your commits since 1.week
Calculating patch hashes, may take a moment...
Located: [PATCH v3 0/9] Some fixes for spi-s3c64xx
---
Generating 1 thank-you letters
Writing: /tmp/tmp.CwdU649vJ4/l_stelmach_samsung_com_patch_v3_0_9_some_fixes_for_spi_s3c64xx.thanks
Traceback (most recent call last):
File "/home/broonie/git/b4/b4/command.py", line 239, in <module>
cmd()
File "/home/broonie/git/b4/b4/command.py", line 222, in cmd
cmdargs.func(cmdargs)
File "/home/broonie/git/b4/b4/command.py", line 60, in cmd_ty
b4.ty.main(cmdargs)
File "/home/broonie/git/b4/b4/ty.py", line 629, in main
auto_thankanator(cmdargs)
File "/home/broonie/git/b4/b4/ty.py", line 384, in auto_thankanator
send_messages(applied, cmdargs.gitdir, cmdargs.outdir, wantbranch, since=cmdargs.since)
File "/home/broonie/git/b4/b4/ty.py", line 431, in send_messages
fh.write(msg.as_bytes()) File "/usr/lib/python3.7/email/message.py", line 178, in as_bytes
g.flatten(self, unixfrom=unixfrom)
File "/usr/lib/python3.7/email/generator.py", line 116, in flatten
self._write(msg)
File "/usr/lib/python3.7/email/generator.py", line 181, in _write
self._dispatch(msg)
File "/usr/lib/python3.7/email/generator.py", line 214, in _dispatch
meth(msg)
File "/usr/lib/python3.7/email/generator.py", line 432, in _handle_text
super(BytesGenerator,self)._handle_text(msg)
File "/usr/lib/python3.7/email/generator.py", line 249, in _handle_text
self._write_lines(payload)
File "/usr/lib/python3.7/email/generator.py", line 155, in _write_lines
self.write(line)
File "/usr/lib/python3.7/email/generator.py", line 406, in write
self._fp.write(s.encode('ascii', 'surrogateescape'))
UnicodeEncodeError: 'ascii' codec can't encode character '\u0141' in position 35: ordinal not in range(128)
This is with commit ca6d35e7728c17b505e6 (Fix some cherry-picking corner cases) on
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks,
Mark
Quoted 5 lines · Mark Brown
Hi,
Attempting to generate thanks with b4 ty -a using current git master I get a traceback:
This is due to the earlier fix to set proper charsets. I need to remember not to rely on Python's as_bytes() mechanism -- we get much better control when we do as_string() and then do the encoding on our own.
The latest master/stable-0.5.y has the fix for this, I hope -- plus for the horrible header encoding.
-K