-
Notifications
You must be signed in to change notification settings - Fork 175
Description
Describe your issue
For some reason I can't get the importlib.resources.files(__package__) to work. In my case this is used by external library jsonschema but I was able to reproduce this in my own code as well. By documentation this should return some Traversable with files in given module. jsonschema library is using it to load some .json files inside the package directory.
In Chaquopy each call to importlib.resources.files(__package__) returns importlib._adapters.DegenerateFiles.Path which means it cannot read files from package dir.
According to this comment: #745 (comment) it should work
Chaquopy version
id 'com.chaquo.python' version '14.0.2' apply false
Devices or emulators where the issue happens
Tested on emulator only, but I think it does not matter
Relevant parts of your code
from importlib import resources
print('==================', resources.files(__package__))
Should shown a Traversable with files from package, istead it shows importlib._adapters.DegenerateFiles.Path
I have tried both with package mentioned in extractPackages and not.