non-ASCII chars not allowed as parameters in cinderclient calls
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-cinderclient |
Fix Released
|
Undecided
|
Michael Dovgal |
Bug Description
When using non-ASCII characters in cinderclient calls, I receive the following error"
"'ascii' codec can't encode character u'\xc7' in position 0: ordinal not in range(128)"
It would appear the error lies in cinderclient/
query_string = "?%s" % parse.urlencode
While preparing a query string we are using urllib.urlencode(). The urlencode library expects data in str format, and doesn't deal well with Unicode data since it doesn't provide a way to specify an encoding.
It would seem there need to be some upfront processing before passing to the urlencode method, such as:
def encoded_
in_dict = dict(params)
out_dict = {}
for k, v in in_dict.
if isinstance(v, unicode):
v = v.encode('utf8')
elif isinstance(v, str):
# Must be encoded in UTF-8
out_dict[k] = v
return list(out_
Changed in python-cinderclient: | |
assignee: | nobody → Michael Dovgal (mdovgal) |
Changed in python-cinderclient: | |
assignee: | Michael Dovgal (mdovgal) → Abhishek Sharma M (abhi.sharma) |
Changed in python-cinderclient: | |
assignee: | nobody → Michael Dovgal (mdovgal) |
Fix proposed to branch: master /review. openstack. org/395684
Review: https:/