Skip to content

struct.error: argument for 's' must be a bytes object #10

@VijayalakshmiSundaravaradhan

Description

net.py is my sample application to set the ip address of my eth0 interface. I get the following error while running the application.

Traceback (most recent call last):
File "net.py", line 119, in
inf.set_ip("192.168.7.59");
File "/usr/lib/python3.5/site-packages/pynetlinux/ifconfig.py", line 210, in set_ip
ifreq = struct.pack('16sH2s4s8s', self.name, AF_INET, '\x00'*2, ipbytes, '\x00'*8)
struct.error: argument for 's' must be a bytes object

Please help me with the error.

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