All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] patman and non-ascii names
@ 2017-01-25  9:33 Chris Packham
  2017-01-25  9:55 ` Chris Packham
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Packham @ 2017-01-25  9:33 UTC (permalink / raw)
  To: u-boot

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.

Thanks,
Chris

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] patman and non-ascii names
  2017-01-25  9:33 [U-Boot] patman and non-ascii names Chris Packham
@ 2017-01-25  9:55 ` Chris Packham
  2017-02-06 15:32   ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Packham @ 2017-01-25  9:55 UTC (permalink / raw)
  To: u-boot

On Wed, Jan 25, 2017 at 10:33 PM, Chris Packham <judge.packham@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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] patman and non-ascii names
  2017-01-25  9:55 ` Chris Packham
@ 2017-02-06 15:32   ` Simon Glass
  2017-02-07  7:11     ` [U-Boot] [PATCH] patman: Handle non-ascii characters in names Chris Packham
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2017-02-06 15:32 UTC (permalink / raw)
  To: u-boot

Hi Chris,

On 25 January 2017 at 01:55, Chris Packham <judge.packham@gmail.com> wrote:
> On Wed, Jan 25, 2017 at 10:33 PM, Chris Packham <judge.packham@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

This seems reasonable - can you send this as a patch please?

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] patman: Handle non-ascii characters in names
  2017-02-06 15:32   ` Simon Glass
@ 2017-02-07  7:11     ` Chris Packham
  2017-02-08 13:03       ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Packham @ 2017-02-07  7:11 UTC (permalink / raw)
  To: u-boot

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(-)

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] patman: Handle non-ascii characters in names
  2017-02-07  7:11     ` [U-Boot] [PATCH] patman: Handle non-ascii characters in names Chris Packham
@ 2017-02-08 13:03       ` Simon Glass
  2017-02-08 17:42         ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2017-02-08 13:03 UTC (permalink / raw)
  To: u-boot

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] patman: Handle non-ascii characters in names
  2017-02-08 13:03       ` Simon Glass
@ 2017-02-08 17:42         ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2017-02-08 17:42 UTC (permalink / raw)
  To: u-boot

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!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-08 17:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25  9:33 [U-Boot] patman and non-ascii names Chris Packham
2017-01-25  9:55 ` Chris Packham
2017-02-06 15:32   ` Simon Glass
2017-02-07  7:11     ` [U-Boot] [PATCH] patman: Handle non-ascii characters in names Chris Packham
2017-02-08 13:03       ` Simon Glass
2017-02-08 17:42         ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.