Skip to content

Commit 9abc619

Browse files
committed
IIBB: fix python3 PyAr#132
1 parent d561eca commit 9abc619

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

iibb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ def ConsultarContribuyentes(self, fecha_desde, fecha_hasta, cuit_contribuyente):
126126
self.xml.contribuyentes.contribuyente.cuitContribuyente = cuit_contribuyente
127127

128128
xml = self.xml.as_xml()
129-
self.CodigoHash = md5(xml).hexdigest()
129+
self.CodigoHash = md5(xml.encode('utf-8')).hexdigest()
130130
nombre = "DFEServicioConsulta_%s.xml" % self.CodigoHash
131131

132132
# guardo el xml en el archivo a enviar y luego lo re-abro:
133-
with open(os.path.join(tempfile.gettempdir(), nombre), "wb") as archivo:
133+
with open(os.path.join(tempfile.gettempdir(), nombre), "w") as archivo:
134134
archivo.write(xml)
135135

136136
if not self.testing:
@@ -147,6 +147,7 @@ def ConsultarContribuyentes(self, fecha_desde, fecha_hasta, cuit_contribuyente):
147147
self.CodigoError = str(self.xml.codigoError)
148148
self.MensajeError = (
149149
str(self.xml.mensajeError)
150+
.encode("ascii", "replace")
150151
)
151152
if "numeroComprobante" in self.xml:
152153
self.NumeroComprobante = str(self.xml.numeroComprobante)

0 commit comments

Comments
 (0)