[Python] Kamene arping() AttributeError: 'NoneType' object has no attribute 'encode'

Discussão em 'Python' iniciado por Stack, Dezembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    This worked, then I stepped away from the code for a week and tried running it again and when running arpcall = arping("192.0.3.*") I receive the error

    WARNING: No route found for IPv6 destination :: (no default route?). This affects only IPv6
    WARNING: can't import layer ipsec: cannot import name 'gcd' from 'fractions' (C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2288.0_x64__qbz5n2kfra8p0\Lib\fractions.py)
    WARNING: No route found (no default route?)
    Traceback (most recent call last):
    File "C:\Users\winmini\Desktop\Finder\MacAdd.py", line 120, in <module>
    arpcall = arping("192.0.3.*")
    ^^^^^^^^^^^^^^^^^^^
    File "C:\Users\winmini\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\kamene\layers\l2.py", line 471, in arping
    ans,unans = srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=net), verbose=verbose,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\winmini\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\kamene\sendrecv.py", line 372, in srp
    s = conf.L2socket(iface=iface, filter=filter, nofilter=nofilter, type=type)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\winmini\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\kamene\arch\pcapdnet.py", line 321, in __init__
    self.ins = open_pcap(iface, 1600, 0, 100)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\winmini\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\kamene\arch\windows\__init__.py", line 237, in <lambda>
    pcapdnet.open_pcap = lambda iface,*args,**kargs: _orig_open_pcap(pcap_name(iface),*args,**kargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\winmini\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\kamene\arch\pcapdnet.py", line 251, in <lambda>
    open_pcap = lambda *args,**kargs: _PcapWrapper_pypcap(*args,**kargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\winmini\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\kamene\arch\pcapdnet.py", line 215, in __init__
    self.iface = create_string_buffer(device.encode('ascii'))
    ^^^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'encode'


    what does this mean? why didn't I encounter this the first time?

    Continue reading...

Compartilhe esta Página