Skip to content

Commit c3df5a9

Browse files
authored
Merge pull request #301 from python/bugfix/257-multiplexed-path-params
Fix regression and restore stdlib reader suppression on Python 3.10
2 parents 9f5b437 + ef414ed commit c3df5a9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

importlib_resources/future/adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def wrapper(*args, **kwargs):
2424
# MultiplexedPath may fail on zip subdirectory
2525
return
2626
# Python 3.10+
27-
if reader.__class__.__module__.startswith('importlib.resources.'):
27+
mod_name = reader.__class__.__module__
28+
if mod_name.startswith('importlib.') and mod_name.endswith('readers'):
2829
return
2930
# Python 3.8, 3.9
3031
if isinstance(reader, _adapters.CompatibilityFiles) and (

importlib_resources/tests/test_files.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ def test_read_text(self):
3434
def test_traversable(self):
3535
assert isinstance(resources.files(self.data), Traversable)
3636

37+
def test_joinpath_with_multiple_args(self):
38+
files = resources.files(self.data)
39+
binfile = files.joinpath('subdirectory', 'binary.file')
40+
self.assertTrue(binfile.is_file())
41+
3742
def test_old_parameter(self):
3843
"""
3944
Files used to take a 'package' parameter. Make sure anyone

newsfragments/257.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restored expectation that stdlib readers are suppressed on Python 3.10.

0 commit comments

Comments
 (0)