pcp
[Top] [All Lists]

Re: [pcp] python api unicode exception

To: Martins Innus <minnus@xxxxxxxxxxx>
Subject: Re: [pcp] python api unicode exception
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Fri, 25 Sep 2015 02:09:08 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <5601A12A.6070109@xxxxxxxxxxx>
References: <5601A12A.6070109@xxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: fU/VknWfxD9D6iLfO8Gi+rC95f93Ag==
Thread-topic: python api unicode exception

----- Original Message -----
> [...]
> File "/usr/lib64/python2.7/site-packages/pcp/pmapi.py", line 1393, in
> pmGetInDom
>     nameL = list(map(lambda x: str(nameA_p[x].decode()), range(status)))
>   File "/usr/lib64/python2.7/site-packages/pcp/pmapi.py", line 1393, in
> <lambda>
>     nameL = list(map(lambda x: str(nameA_p[x].decode()), range(status)))
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position
> 2247: ordinal not in range(128)
> Our simple local fix to get things working is:
> [...]
> 
> Maybe someone who understands passing unicode between C and python has a
> better understanding of the correct/different fix?
> 

Thanks Martins - I've merged something very similar, audited the other
places where we are exposed to the same failure-to-decode-instance-names
(three other spots, same fix), and added a test case.

Could you review & verify the master branch for your failing case?  Taa.

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>