I would like to create a dict based on MAC addresses and vendor, using the mac-vendor-lookup library. My code:
dicts = {}
for index, value in mac_series.items():
try:
vendor = mac.lookup(value)
except KeyError as e:
print(f"Error: {e}")
vendor = "UNKNOWN"
dicts[value] = vendor
This works fine, because I handle KeyErrors in the try/except. However I'd like to know why I get a KeyError in the first place, when the Mac addresses all follow a certain format. So I get mostly vendors coming back, but sometimes the occasional "UNKNOWN". Is this an issue with an outdated lookup (despite using the latest pip package)?