You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_______________OpenNamespaceTests.test_non_paths_in_dunder_path_______________self=<importlib_resources.tests.test_files.OpenNamespaceTeststestMethod=test_non_paths_in_dunder_path>deftest_non_paths_in_dunder_path(self):
""" Non-path items in a namespace package's ``__path__`` are ignored. As reported in python/importlib_resources#311, some tools like Setuptools, when creating editable packages, will inject non-paths into a namespace package's ``__path__``, a sentinel like ``__editable__.sample_namespace-1.0.finder.__path_hook__`` to cause the ``PathEntryFinder`` to be called when searching for packages. In that case, resources should still be loadable. """importnamespacedata01namespacedata01.__path__.append(
'__editable__.sample_namespace-1.0.finder.__path_hook__'
)
>resources.files(namespacedata01)
importlib_resources/tests/test_files.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
importlib_resources/_common.py:46: inwrapperreturnfunc(anchor)
importlib_resources/_common.py:56: infilesreturnfrom_package(resolve(anchor))
importlib_resources/_common.py:117: infrom_packagereader=spec.loader.get_resource_reader(spec.name)
importlib_resources/future/adapters.py:64: inget_resource_reader_skip_degenerate(_block_standard(super().get_resource_reader)(name))
importlib_resources/future/adapters.py:22: inwrapperreader=reader_getter(*args, **kwargs)
importlib_resources/_adapters.py:29: inget_resource_readerreturnCompatibilityFiles(self.spec)._native()
importlib_resources/_adapters.py:153: in_nativereader=self._readerimportlib_resources/_adapters.py:147: in_readerreturnself.spec.loader.get_resource_reader(self.spec.name)
<frozenimportlib._bootstrap_external>:1452: inget_resource_reader
???
/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/importlib/resources/readers.py:136: in__init__self.path=MultiplexedPath(*map(self._resolve, namespace_path))
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls=<class'importlib.resources.readers.NamespaceReader'>path_str='__editable__.sample_namespace-1.0.finder.__path_hook__'@classmethoddef_resolve(cls, path_str) ->abc.Traversable:
r""" Given an item from a namespace path, resolve it to a Traversable. path_str might be a directory on the filesystem or a path to a zipfile plus the path within the zipfile, e.g. ``/foo/bar`` or ``/foo/baz.zip/inner_dir`` or ``foo\baz.zip\inner_dir\sub``. """> (dir,) = (candforcandincls._candidate_paths(path_str) ifcand.is_dir())
EValueError: notenoughvaluestounpack (expected1, got0)
/opt/hostedtoolcache/Python/3.13.0-rc.2/x64/lib/python3.13/importlib/resources/readers.py:147: ValueError
The text was updated successfully, but these errors were encountered:
The issue is that the fix for #311 isn't yet in Python 3.13, so 3.13 gets the failure. Is this logic new to 3.13? It must be. That means we should get a bugfix out to 3.13 ASAP.
The text was updated successfully, but these errors were encountered: