Skip to content

Conversation

@mh4x0f
Copy link

@mh4x0f mh4x0f commented Jan 7, 2023

when we load a custom cache_path file from my machine i got errors. for this example bellow, the app crash:

from mac_vendor_lookup import MacLookup, BaseMacLookup

BaseMacLookup.cache_path = "/home/storage/mac-vendors.txt"
mac = MacLookup()
    
def find_mac(mac_address):
    print(mac.lookup(mac_address))

my patch solve this problem. thanks

@tomerkal
Copy link

The change you're suggesting breaks the current assumption that update_vendors writes to the cache file lines in the format of <prefix>:<vendor>.
What happened is that you probably loaded the OUI file directly to the cache path, which is wrong. You then got errors because there are no : in most lines and the load_vendors logic broke. If you want to manually update the cached list, it needs to follow the : line structure.
Anyway, the change proposed here will lead to errors (update_vendors writes the cache with the : format, the your suggested load_vendors tries to read the same file with the (base 16) format).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants