Browse Source

3: Auto stash before merge of "master3" and "origin/master3"

pull/283/head
Gabriel Balog 8 years ago
parent
commit
e98d493fae
  1. 2
      pytrustnfe/utils.py
  2. 3
      pytrustnfe/xml/__init__.py

2
pytrustnfe/utils.py

@ -85,6 +85,8 @@ def _find_node(xml, node):
def gerar_nfeproc(envio, recibo):
NSMAP = {None: 'http://www.portalfiscal.inf.br/nfe'}
root = ET.Element("nfeProc", versao="3.10", nsmap=NSMAP)
if 'encoding="utf-8"' in recibo:
recibo = re.sub('encoding="utf-8"', '', recibo)
docEnvio = ET.fromstring(envio)
docRecibo = ET.fromstring(recibo)

3
pytrustnfe/xml/__init__.py

@ -58,7 +58,8 @@ def render_xml(path, template_name, remove_empty, **nfe):
def sanitize_response(response):
response = re.sub('encoding="UTF-8"', '', response)
if 'encoding="utf-8"' in response or 'encoding="UTF-8"' in response:
response = re.sub('encoding="UTF-8"', '', response)
tree = etree.fromstring(response)
# Remove namespaces inuteis na resposta
for elem in tree.getiterator():

Loading…
Cancel
Save