New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Customer Fails with unicode error #25

Closed
michaelrice opened this Issue Oct 24, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@michaelrice
Copy link
Owner

michaelrice commented Oct 24, 2014

Getting error trying to create customer:

2014-10-20 11:14:10,360 - root - ERROR - An unexpected exception has happened.
Traceback (most recent call last):
  File "/usr/local/bin/money_gun.py", line 99, in <module>
    customers.create_customer(vcum_connection, customer)
  File "/root/Envs/rainmaker/lib/python2.7/site-packages/thunderhead/builder/customers.py", line 127, in create_customer
    customer_data = _build_customer_payload(customer)
  File "/root/Envs/rainmaker/lib/python2.7/site-packages/thunderhead/builder/customers.py", line 102, in _build_customer_payload
    return tostring(root)
  File "/usr/local/python2.7/lib/python2.7/xml/etree/ElementTree.py", line 1126, in tostring
    ElementTree(element).write(file, encoding, method=method)
  File "/usr/local/python2.7/lib/python2.7/xml/etree/ElementTree.py", line 820, in write
    serialize(write, self._root, encoding, qnames, namespaces)
  File "/usr/local/python2.7/lib/python2.7/xml/etree/ElementTree.py", line 939, in _serialize_xml
    _serialize_xml(write, e, encoding, qnames, None)
  File "/usr/local/python2.7/lib/python2.7/xml/etree/ElementTree.py", line 937, in _serialize_xml
    write(_escape_cdata(text, encoding))
  File "/usr/local/python2.7/lib/python2.7/xml/etree/ElementTree.py", line 1073, in _escape_cdata
    return text.encode(encoding, "xmlcharrefreplace")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128)

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25

michaelrice added a commit that referenced this issue Oct 25, 2014

fixes issue with non-ascii chars in customer
This fix adds support for non ascii names in customers
by doing a decode utf8 on the strings. fixes #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment