caktus / python-assistly

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Unicode support #1

Open poirier opened 12 years ago

poirier commented 12 years ago

Error when trying to submit a form with non-ASCII content:

File "/home/secure/ccsr/www/production/env/local/lib/python2.7/site-packages/assistly/base.py", line 298, in interaction_create return AssistlyResponse(self._post('interactions.json', kwargs))

File "/home/secure/ccsr/www/production/env/local/lib/python2.7/site-packages/assistly/base.py", line 203, in _post return self._request_url('POST', url, query_params, params, using_cache=False)

File "/home/secure/ccsr/www/production/env/local/lib/python2.7/site-packages/assistly/base.py", line 170, in _request_url encoded_post_params = urllib.urlencode(post_params) if post_params else ''

File "/usr/lib/python2.7/urllib.py", line 1282, in urlencode v = quote_plus(str(v))

UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 797: ordinal not in range(128)

mlavin commented 12 years ago

I fixed a related ticket for CBS recently. There is a related Python ticket: http://bugs.python.org/issue1712522

mlavin commented 12 years ago

I believe this is handled properly by requests if that's an option to use here instead of urllib.