Stucts pack requires bytes arguements
@@ -33,7 +33,7 @@ def interface_ip(interface):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(
fcntl.ioctl(
- sock.fileno(), 0x8915, struct.pack('256s', interface[:15])
+ sock.fileno(), 0x8915, struct.pack('256s', interface[:15].encode('utf-8'))
)[20:24]
)
# Explanation:
