Skip to content

TypeError when using Python 3 #3

@erewashtech

Description

@erewashtech

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions