Issue 9 in pyactiveresource: Encoding problem

2 views
Skip to first unread message

codesite...@google.com

unread,
Jun 25, 2009, 2:44:24 PM6/25/09
to pyactive...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 9 by timothee.peignier: Encoding problem
http://code.google.com/p/pyactiveresource/issues/detail?id=9

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

Attachments:
9-unicode-urls.diff 495 bytes

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages