Bug 2246093 - python-netaddr fails to build with Python 3.13: AttributeError: module 'importlib.resources' has no attribute 'open_binary'
Summary: python-netaddr fails to build with Python 3.13: AttributeError: module 'impor...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-netaddr
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: John Eckersberg
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-25 12:02 UTC by Karolina Surma
Modified: 2023-12-14 17:44 UTC (History)
4 users (show)

Fixed In Version: python-netaddr-0.9.0-2.fc40
Clone Of:
Environment:
Last Closed: 2023-12-14 17:44:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github netaddr netaddr pull 272 0 None open Python 3.13 compatibility 2023-10-25 15:53:28 UTC

Description Karolina Surma 2023-10-25 12:02:08 UTC
python-netaddr fails to build with Python 3.13.0a1.

+ py.test-3.13
============================= test session starts ==============================
platform linux -- Python 3.13.0a1, pytest-7.4.2, pluggy-1.2.0
rootdir: /builddir/build/BUILD/netaddr-0.9.0
collected 275 items / 1 error

==================================== ERRORS ====================================
___________ ERROR collecting netaddr/tests/eui/test_ieee_parsers.py ____________
/usr/lib/python3.13/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.13/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.13/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/usr/lib/python3.13/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.13/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/usr/lib/python3.13/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/usr/lib/python3.13/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.13/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1381: in _gcd_import
    ???
<frozen importlib._bootstrap>:1354: in _find_and_load
    ???
<frozen importlib._bootstrap>:1325: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:929: in _load_unlocked
    ???
/usr/lib/python3.13/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
netaddr/tests/eui/test_ieee_parsers.py:7: in <module>
    from netaddr.eui.ieee import OUIIndexParser, IABIndexParser, FileIndexer
netaddr/eui/ieee.py:292: in <module>
    load_indices()
netaddr/eui/ieee.py:283: in load_indices
    load_index(OUI_INDEX, _importlib_resources.open_binary(__package__, 'oui.idx'))
E   AttributeError: module 'importlib.resources' has no attribute 'open_binary'
=========================== short test summary info ============================
ERROR netaddr/tests/eui/test_ieee_parsers.py - AttributeError: module 'import...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.66s ===============================

The deprecated importlib.resources methods were removed from Python 3.13:
- contents()
- is_resource()
- open_binary()
- open_text()
- path()
- read_binary()
- read_text()
Use files() instead. Refer to importlib-resources: Migrating from Legacy for migration advice.
https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06551091-python-netaddr/

For all our attempts to build python-netaddr with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-netaddr/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Update System 2023-12-14 16:23:41 UTC
FEDORA-2023-7ded397c79 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-7ded397c79

Comment 2 Fedora Update System 2023-12-14 17:44:02 UTC
FEDORA-2023-7ded397c79 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.