pyigtl icon indicating copy to clipboard operation
pyigtl copied to clipboard

Struct pack error when making OpenIGTLinkServer on Linux

Open keiranbarr opened this issue 1 year ago • 0 comments

While attempting to create an OpenIGTLinkServer with 'local_server=False' on Linux in Python 3.11, I received the following error:

File "/home/adminpi5/Documents/MCSTrack/.venv/lib/python3.11/site-packages/pyigtl/comm.py", line 174, in init self.host = socket.inet_ntoa(fcntl.ioctl(soc.fileno(), 0x8915, struct.pack('256s', ifname[:15]))[20:24]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct.error: argument for 's' must be a bytes object

I found the following StackOverflow post which solved the issue, and I can now connect seamlessly. I thought it might be appropriate to create an issue to document this, and a corresponding pull request.

keiranbarr avatar Jul 03 '24 20:07 keiranbarr