diff --git a/importlib_resources/future/adapters.py b/importlib_resources/future/adapters.py index 9aa5b5e..9d26bf4 100644 --- a/importlib_resources/future/adapters.py +++ b/importlib_resources/future/adapters.py @@ -24,7 +24,8 @@ def wrapper(*args, **kwargs): # MultiplexedPath may fail on zip subdirectory return # Python 3.10+ - if reader.__class__.__module__.startswith('importlib.resources.'): + mod_name = reader.__class__.__module__ + if mod_name.startswith('importlib.') and mod_name.endswith('readers'): return # Python 3.8, 3.9 if isinstance(reader, _adapters.CompatibilityFiles) and ( diff --git a/importlib_resources/tests/test_files.py b/importlib_resources/tests/test_files.py index 9e45f70..3e86ec6 100644 --- a/importlib_resources/tests/test_files.py +++ b/importlib_resources/tests/test_files.py @@ -34,6 +34,11 @@ def test_read_text(self): def test_traversable(self): assert isinstance(resources.files(self.data), Traversable) + def test_joinpath_with_multiple_args(self): + files = resources.files(self.data) + binfile = files.joinpath('subdirectory', 'binary.file') + self.assertTrue(binfile.is_file()) + def test_old_parameter(self): """ Files used to take a 'package' parameter. Make sure anyone diff --git a/newsfragments/257.bugfix.rst b/newsfragments/257.bugfix.rst new file mode 100644 index 0000000..d8feffd --- /dev/null +++ b/newsfragments/257.bugfix.rst @@ -0,0 +1 @@ +Restored expectation that stdlib readers are suppressed on Python 3.10. \ No newline at end of file