diff --git a/pytrustnfe/nfse/paulistana/__init__.py b/pytrustnfe/nfse/paulistana/__init__.py index ed0611b..44019b8 100644 --- a/pytrustnfe/nfse/paulistana/__init__.py +++ b/pytrustnfe/nfse/paulistana/__init__.py @@ -54,10 +54,10 @@ def _send(certificado, method, **kwargs): 'object': None } - response, obj = sanitize_response(response) + response, obj = sanitize_response(response.encode('utf-8')) return { 'sent_xml': xml_send, - 'received_xml': response, + 'received_xml': response.decode(), 'object': obj } diff --git a/pytrustnfe/xml/__init__.py b/pytrustnfe/xml/__init__.py index 0d11eab..0ed0ee5 100644 --- a/pytrustnfe/xml/__init__.py +++ b/pytrustnfe/xml/__init__.py @@ -46,7 +46,7 @@ def render_xml(path, template_name, remove_empty, **nfe): def sanitize_response(response): - tree = etree.fromstring(response.encode('utf-8')) + tree = etree.fromstring(response) # Remove namespaces inuteis na resposta for elem in tree.getiterator(): if not hasattr(elem.tag, 'find'):