Skip to content

Commit

Permalink
Merge pull request aricaldeira#11 from Trust-Code/feature/melhoria_lo…
Browse files Browse the repository at this point in the history
…g_pysped

[FIX] Correção de problema com unicode ao valida NF-e
  • Loading branch information
danimaribeiro committed Sep 30, 2015
2 parents f3b1376 + 84468b6 commit a1ac28e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pysped/xml_sped/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,11 @@ def validar(self):
# para evitar erros de conversão unicode para ascii
xml = tira_abertura(self.xml).encode('utf-8')

esquema = etree.XMLSchema(etree.parse(arquivo_esquema))
#esquema.assertValid(etree.fromstring(xml))
esquema = etree.XMLSchema(etree.parse(arquivo_esquema))
esquema.validate(etree.fromstring(xml))

return esquema.error_log
namespace = '{http://www.portalfiscal.inf.br/nfe}'
return "\n".join([x.message.replace(namespace, '') for x in esquema.error_log])

def le_grupo(self, raiz_grupo, classe_grupo, sigla_ns='nfe'):
tags = []
Expand Down

0 comments on commit a1ac28e

Please sign in to comment.