[U-Boot] patman and non-ascii names

Chris Packham judge.packham at gmail.com
Wed Jan 25 10:55:48 CET 2017


On Wed, Jan 25, 2017 at 10:33 PM, Chris Packham <judge.packham at gmail.com> wrote:
> Hi All,
>
> Just ran into an issue with patman. It's picking up David Müller as a
> cc recipient. But seems to barf because of the non-ascii characters in
> his name
>
>
>   File "./tools/patman/patman", line 159, in <module>
>     options.add_maintainers)
>   File "./tools/patman/series.py", line 238, in MakeCcFile
>     print(cover_fname, ', '.join(set(cover_cc + all_ccs)), file=fd)
>   UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 8: ordinal not in range(128)
>
> When I exclude the patch that David's picked as a Cc there is no problem.
>
> Any suggestions. I assume something involving .decode('utf-8') is required.
>

This seems to work for me but the decode()/encode() makes me think
something is more complicated than it needs to be.

diff --git a/tools/patman/series.py b/tools/patman/series.py
index 38a452edad41..c1b86521aa45 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -235,7 +235,8 @@ class Series(dict):

         if cover_fname:
             cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
-            print(cover_fname, ', '.join(set(cover_cc + all_ccs)), file=fd)
+            cc_list = ', '.join([x.decode('utf-8') for x in
set(cover_cc + all_ccs)])
+            print(cover_fname, cc_list.encode('utf-8'), file=fd)

         fd.close()
         return fname


More information about the U-Boot mailing list