patman: Handle non-ascii characters in names
authorChris Packham <judge.packham@gmail.com>
Tue, 7 Feb 2017 07:11:00 +0000 (20:11 +1300)
committerSimon Glass <sjg@chromium.org>
Wed, 8 Feb 2017 13:12:16 +0000 (06:12 -0700)
When gathering addresses for the Cc list patman would encounter a
UnicodeDecodeError due to non-ascii characters in the author name.
Address this by explicitly using utf-8 when building the Cc list.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
tools/patman/series.py

index 38a452e..c1b8652 100644 (file)
@@ -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