Livewire-Routing-Protocol-Client icon indicating copy to clipboard operation
Livewire-Routing-Protocol-Client copied to clipboard

TypeError when using Python 3

Open erewashtech opened this issue 6 years ago • 1 comments

Hi

I am trying to use the LWRPClient in Python 3 and am receiving an error when trying to print the status of the GPI ports.

Code I am trying to execute:

from LWRPClient import LWRPClient
LWRP = LWRPClient("*IP Removed*", 93)
LWRP.login()

print (LWRP.GPIData())

I then receive the following error from my Python shell:

Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\dmartin\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner self.run() File "S:\GPO Monitor\v2\LWRPClientComms.py", line 59, in run sent = self.sock.send(dataToSend) TypeError: a bytes-like object is required, not 'str'

The shell then prints 'None' before finishing and the LWRP connection terminates.

Thanks, Dan

erewashtech avatar Oct 30 '19 17:10 erewashtech

In case you still need this Dan, or if anyone comes across this as I did, applying the 2 line changes in the open pull request fixes this: https://github.com/anthonyeden/Livewire-Routing-Protocol-Client/pull/4

lbcard avatar Mar 07 '21 22:03 lbcard