Migrating from `importlib.resources.open_text` to `files` looks broken
First of all, let me say the pyoxidizer works great! I have a pure python project where I use pyoxidizer to build a fully standalone executable (no issues here).
I wanted to get rid of some warnings in that Python project and migrate from importlib.resources.open_text to the files API, as described here.
It looks like this breaks pyoxidizer:
File "importlib.resources", line 147, in files
File "importlib._common", line 14, in from_package
File "importlib._common", line 18, in fallback_resources
File "pathlib", line 1082, in __new__
File "pathlib", line 707, in _from_parts
File "pathlib", line 691, in _parse_args
TypeError: expected str, bytes or os.PathLike object, not NoneType
After digging a bit, it looks like the files() as implemented here relies on fallback_resources as implemented there.
The python modules returned by import_module from oxidized_importer.OxidizedFinder, seem to have their __spec__.origin set to None. This breaks the fallback_resources, that is never called when using open_text (there seems to be a fallback on empty __spec__.origin in that code path).
I was also trying to use the updated files() interface, and in particular the feature where (in conjunction with as_file()) it offers directory support, released in v5.9.0 of importlib_resources...
Currently, using pyoxidizer, I similarly get a TypeError due to the NoneType returned.
Better than relying on fallback_resources, I'd like for PyOxidizer/OxidizedFinder to implement the preferred TraversableResources interface, mentioned here, and specified here.