PyNFe icon indicating copy to clipboard operation
PyNFe copied to clipboard

Erro consulta NFS

Open Weslei25 opened this issue 1 year ago • 1 comments

Olá pessoal, hoje ao testar a parte de NFS me deparei com alguns erros e esse foi um deles, conseguem me ajudar certificado e senha são meus proprios.

Exception has occurred: AttributeError 'int' object has no attribute 'attrib' File "C:\PROJETOS\CONSULTA_NFS\teste.py", line 21, in xml = a1.assinar(nfse, retorna_string=True) AttributeError: 'int' object has no attribute 'attrib'

image

Weslei25 avatar Jun 05 '24 12:06 Weslei25

@Weslei25 NFS-e está bem desatualizado e precisa passar por uma atualização de código. Qual a cidade e autorizador?

juniortada avatar Jun 14 '24 12:06 juniortada

O SerializacaoGinfes.consultar_nfse(), e portanto também o SerializacaoNfse.consultar_nfse() retornam o XML em formato str, porém, o AssinaturaA1.assinar() só aceita o XML no formato etree._Element, causando o erro.

Para facilitar esse entendimento, acrescentei a tipagem do parâmetro de entrada do AssinaturaA1.assinar() neste PR: https://github.com/TadaSoftware/PyNFe/pull/405

leandroguimaraes avatar Apr 10 '25 21:04 leandroguimaraes