From 99dd4ae7c1be91145e0c3e1cd2543ea7d9dad96f Mon Sep 17 00:00:00 2001 From: Andre Kablukow Date: Thu, 12 Nov 2015 16:27:15 -0200 Subject: [PATCH] corrigido ComunicacaoSefaz para SP --- pynfe/processamento/comunicacao.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pynfe/processamento/comunicacao.py b/pynfe/processamento/comunicacao.py index 5894a9d..d652fbd 100644 --- a/pynfe/processamento/comunicacao.py +++ b/pynfe/processamento/comunicacao.py @@ -50,7 +50,11 @@ class ComunicacaoSefaz(Comunicacao): if indSinc == 1: # Procuta status no xml ns = {'ns':'http://www.portalfiscal.inf.br/nfe'} # namespace - prot = etree.fromstring(retorno.text) + try: + prot = etree.fromstring(retorno.text) + except ValueError: + #em SP retorno.text apresenta erro + prot = etree.fromstring(retorno.content) try: # Protocolo com envio OK infProt = prot[1][0][0][6] # root protNFe