pyigtl
pyigtl copied to clipboard
Struct pack error when making OpenIGTLinkServer on Linux
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.