Skip to content

Commit 8684c7a

Browse files
committed
Add workaround for broken importlib.resources when an editable sentinel is present.
Closes #318
1 parent d116be1 commit 8684c7a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

importlib_resources/future/adapters.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ def wrapper(*args, **kwargs):
2323
except NotADirectoryError:
2424
# MultiplexedPath may fail on zip subdirectory
2525
return
26+
except ValueError as exc:
27+
# NamespaceReader in stdlib may fail for editable installs
28+
# (python/importlib_resources#311, python/importlib_resources#318)
29+
# Remove after bugfix applied to Python 3.13.
30+
if "not enough values to unpack" not in str(exc):
31+
raise
32+
return
2633
# Python 3.10+
2734
mod_name = reader.__class__.__module__
2835
if mod_name.startswith('importlib.') and mod_name.endswith('readers'):

0 commit comments

Comments
 (0)