You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Rohit Yadav (JIRA)" <ji...@apache.org> on 2013/04/16 07:13:15 UTC

[jira] [Commented] (CLOUDSTACK-2020) CloudMonkey requester.py can't deal with unicode dictionaries

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13632572#comment-13632572 ] 

Rohit Yadav commented on CLOUDSTACK-2020:
-----------------------------------------

If I do, x.lower() I'm assuming x is a string; to be safe I had used str.lower(obj). I checked, we're actually passing string args so should not be a problem. Thanks Sebastien for your workaround it's fine. I've tested and pushed the change, in case we later find it breaks somewhere we can fix that later, for now unicodes should pass. Let me know if it has any further unicode troubles. Cheers.
                
> CloudMonkey requester.py can't deal with unicode dictionaries
> -------------------------------------------------------------
>
>                 Key: CLOUDSTACK-2020
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-2020
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Cloudmonkey
>    Affects Versions: 4.1.0
>            Reporter: sebastien goasguen
>            Assignee: Rohit Yadav
>             Fix For: 4.2.0
>
>
> Rohit,
> I am using the requester.py from cloudmonkey.
> I noticed that passing a dictionary with unicode causes problems.
> I changed it to:
> ----
>   request.sort(key=lambda x: x[0].lower())
>     request_url = "&".join(["=".join([r[0], urllib.quote_plus(str(r[1]))])
>                            for r in request])
>     hashStr = "&".join(["=".join([r[0].lower(),
>                        str.lower(urllib.quote_plus(str(r[1]))).replace("+",
>                        "%20")]) for r in request])
> ---
> notice the x[0].lower() instead of str.lower(x[0])
> and the r[0].lower()
> Is there a reason you used str. ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira