sugarcrm/python_webservices_library — Issue #4: UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3'
Author: SinOB
Created: 2011-11-29 12:04:05+00:00
State: open

If sugarcrm returns the following in a response

Initial 2011a customer reports contract - £6k, circa 65 credits

the following error is received

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

Traceback (most recent call last):
File "sugar_wrapper.py", line 47, in
response=temp.get_products_for_account("ae6dbac6-737c-a1cc-80e8-4bf7129e7833")
File "sugar_wrapper.py", line 39, in get_products_for_account
results = response.get_entry_list(module, query, order_by, offset, select_fields, link_name_to_fields_array)
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 202, in get_entry_list
return self.sendRequest('get_entry_list', args)
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 81, in sendRequest
result = stripUnicode(result)
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in stripUnicode
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 372, in stripUnicode
return list( stripUnicode(x) for x in obj )
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 372, in
return list( stripUnicode(x) for x in obj )
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in stripUnicode
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in stripUnicode
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in stripUnicode
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 370, in
return dict( (str(key), stripUnicode(value)) for (key, value) in obj.items())
File "/usr/local/lib/python2.7/dist-packages/sugarcrm/sugarcrm.py", line 368, in stripUnicode
return str(obj)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 39: ordinal not in range(128)