Skip to content

Lots of errors #2

@fnoop

Description

@fnoop

Hi, a very simple test script running under python3.7 runs perfectly in PyRIC, gets lots of errors in your fork. This is the test code:

try:
        card = pyw.getcard(i)
        print("Card info: {}".format(repr(card)))
        devinfo = pyw.devinfo(i)
        print("Dev info: {}".format(repr(devinfo)))
        ifinfo = pyw.ifinfo(card)
        print("Interface info: {}".format(repr(ifinfo)))
        phyinfo = pyw.phyinfo(card)
        #print("Physical info: {}".format(repr(phyinfo)))
        for phy in phyinfo:
            print("{}: {}".format(phy, phyinfo[phy]))
        print("Card Up? '{}'".format(pyw.isup(card)))
        print("Card Blocked? '{}'".format(pyw.isblocked(card)))
        
        print("PM enabled? {}".format(pyw.pwrsaveget(card)))
        print("TX: {}".format(pyw.txget(card)))
        print("Standards: {}".format(pyw.devstds(card)))
        print()
    except pyric.error as e:
        print("Error: {}".format(repr(e)))

These are the errors:

Traceback (most recent call last):
  File "/srv/maverick/code/networking/pyric/pyw.py", line 1216, in devinfo
    dev = card.dev
AttributeError: 'str' object has no attribute 'dev'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./hybrid-test.py", line 15, in winfo
    card = pyw.getcard(i)
  File "/srv/maverick/code/networking/pyric/pyw.py", line 448, in getcard
    return _nlstub_(getcard, dev)
  File "/srv/maverick/code/networking/pyric/pyw.py", line 2542, in _nlstub_
    return fct(*argv)
  File "/srv/maverick/code/networking/pyric/pyw.py", line 449, in getcard
    return devinfo(dev, nlsock)["card"]
  File "/srv/maverick/code/networking/pyric/pyw.py", line 1220, in devinfo
    idx = _ifindex_(dev)
  File "/srv/maverick/code/networking/pyric/pyw.py", line 2469, in _ifindex_
    return _iostub_(_ifindex_, dev)
  File "/srv/maverick/code/networking/pyric/pyw.py", line 2522, in _iostub_
    return fct(*argv)
  File "/srv/maverick/code/networking/pyric/pyw.py", line 2474, in _ifindex_
    return struct.unpack_from(ifr_ifindex, ret, IFNAMELEN)[0]
NameError: name 'ifr_ifindex' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./hybrid-test.py", line 47, in <module>
    winfo(interface)
  File "./hybrid-test.py", line 32, in winfo
    except pyric.error as e:
AttributeError: module 'pyric' has no attribute 'error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./hybrid-test.py", line 51, in <module>
    except pyric.error as e:
AttributeError: module 'pyric' has no attribute 'error'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions