[U-Boot] [PATCH] patman: Handle non-ascii characters in names

Chris Packham judge.packham at gmail.com
Tue Feb 7 07:11:00 UTC 2017


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 at gmail.com>
---
On Tue, Feb 7, 2017 at 4:32 AM, Simon Glass <sjg at chromium.org> wrote:
> Hi Chris,
>
<snip>
>
> This seems reasonable - can you send this as a patch please?
>
> Regards,
> Simon

Here you go. I've only been able to test with python 2.7 but I think it
should be fine for python 3.x also.

 tools/patman/series.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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
-- 
2.11.0.24.ge6920cf



More information about the U-Boot mailing list