Skip to content

Commit

Permalink
IIBB: fix temp file unicode error (binary open)
Browse files Browse the repository at this point in the history
```
Traceback: Traceback (most recent call last):
  File "/src/abernardi/iibb.py", line 134, in ConsultarContribuyentes
    archivo.write(xml)
TypeError: write() argument must be str, not bytes
```
  • Loading branch information
reingart committed Aug 27, 2023
1 parent f03cfb8 commit 22a6a52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iibb.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def ConsultarContribuyentes(self, fecha_desde, fecha_hasta, cuit_contribuyente):
nombre = "DFEServicioConsulta_%s.xml" % self.CodigoHash

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

if not self.testing:
Expand Down

0 comments on commit 22a6a52

Please sign in to comment.