What steps will reproduce the problem?
1. Use a unicode value (with an accent) as a url param
What is the expected output? What do you see instead?
Urlencoding should work flawlessly, instead there is an encoding error :
File "/env/lib/python2.5/site-packages/pyactiveresource/activeresource.py",
line 359, in
find_first
resources = cls._find_every(from_=from_, **kwargs)
File "/env/lib/python2.5/site-packages/pyactiveresource/activeresource.py", line 473, in
_find_every
path = from_ + cls._query_string(kwargs)
File "/env/lib/python2.5/site-packages/pyactiveresource/activeresource.py", line 521, in
_query_string
return '?' + urllib.urlencode(query_options)
File "/usr/lib/python2.5/urllib.py", line 1250, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 6:
ordinal not in
range(128)
I've attached a patch that fix it (without unit test and a bit hackish).
Original issue reported on code.google.com by timothee...@gmail.com on 25 Jun 2009 at 6:44
Original issue reported on code.google.com by
timothee...@gmail.com
on 25 Jun 2009 at 6:44Attachments: