netaddr / netaddr

A network address manipulation library for Python

Home Page:https://netaddr.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DeprecationWarning: open_binary is deprecated

cbueche opened this issue · comments

In netaddr/eui/ieee.py and netaddr/eui/__init__.py, there are calls to open_binary(), leading to this deprecation warning:

netaddr/eui/ieee.py:284: DeprecationWarning: open_binary is deprecated. Use files() instead.
    Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    load_index(OUI_INDEX, _importlib_resources.open_binary(__package__, 'oui.idx'))

Same issue with load_index(IAB_INDEX, _importlib_resources.open_binary(__package__, 'iab.idx'))

I'm using Python 3.11.

The code to reproduce the error :

from netaddr import EUI
mac_entry='38:22:e2:8c:ef:92'
mac = EUI(mac_entry)
mac_org = mac.oui.registration(0).org
print(mac_org)

Hey, thank you for the report. This has been resolved in #272 – not released yet.

oh crap I checked but didn't see that issue and the fix. All good then and thx for the good job!

No worries, appreciate it! I'll release a new version soon.