Buen día,
Estoy probando PyAfipWs para python3 y cuando realizo la primer prueba me da el error que transcribo mas abajo.
git clone
https://github.com/pyar/pyafipws.git -b py3k
cd pyafipws
mkvirtualenv py3k
pip install -r requirements.txt
python setup.py install
cd ejemplos
python factura_electronica.py
Tuve inconvenientes para instalar m2crypto en el virtualenv pero haciendo "apt install swig" lo pude resolver y todas las dependencias se instalaron correctamente.
Tengo python 3.7.3
El certificado que uso es el de ejemplo que está en el sitio (reingart.crt reingart.key)
Intenté ver el código donde se produce el error pero no logro ver el problema.
Gracias desde ya por la ayuda.
Traceback (most recent call last):
File "factura_electronica.py", line 252, in <module>
facturar(regs)
File "factura_electronica.py", line 57, in facturar
ta = wsaa.Autenticar("wsfe", CERT, PRIVATEKEY, wsdl=URL_WSAA, cache=CACHE, debug=True)
File "/home/devuser/.venvs/py3k/lib/python3.7/site-packages/PyAfipWs-3.7.0-py3.7.egg/pyafipws/wsaa.py", line 353, in Autenticar
cms = self.SignTRA(tra, crt, key)
File "/home/devuser/.venvs/py3k/lib/python3.7/site-packages/PyAfipWs-3.7.0-py3.7.egg/pyafipws/utils.py", line 131, in capturar_errores_wrapper
return func(self, *args, **kwargs)
File "/home/devuser/.venvs/py3k/lib/python3.7/site-packages/PyAfipWs-3.7.0-py3.7.egg/pyafipws/wsaa.py", line 296, in SignTRA
return sign_tra(tra, cert, privatekey, passphrase)
File "/home/devuser/.venvs/py3k/lib/python3.7/site-packages/PyAfipWs-3.7.0-py3.7.egg/pyafipws/wsaa.py", line 95, in sign_tra
buf = BIO.MemoryBuffer(tra) # Crear un buffer desde el texto
File "/home/devuser/.venvs/py3k/lib/python3.7/site-packages/M2Crypto/BIO.py", line 187, in __init__
"data must be bytes or None, not %s" % (type(data).__name__, ))
TypeError: data must be bytes or None, not str