diff mbox

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

Message ID 20170207071100.21495-1-judge.packham@gmail.com
State Accepted
Commit f11a0af713a714ee2efcd810dd81c6dfd59381aa
Delegated to: Simon Glass
Headers show

Commit Message

Chris Packham Feb. 7, 2017, 7:11 a.m. UTC
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>
---
On Tue, Feb 7, 2017 at 4:32 AM, Simon Glass <sjg@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(-)

Comments

Simon Glass Feb. 8, 2017, 1:03 p.m. UTC | #1
On 7 February 2017 at 00:11, Chris Packham <judge.packham@gmail.com> wrote:
> 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>
> ---
> On Tue, Feb 7, 2017 at 4:32 AM, Simon Glass <sjg@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(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Feb. 8, 2017, 5:42 p.m. UTC | #2
On 8 February 2017 at 06:03, Simon Glass <sjg@chromium.org> wrote:
> On 7 February 2017 at 00:11, Chris Packham <judge.packham@gmail.com> wrote:
>> 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>
>> ---
>> On Tue, Feb 7, 2017 at 4:32 AM, Simon Glass <sjg@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(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!
diff mbox

Patch

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