-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example of using importlib.resources.files() in Python 3.12 #6
Comments
It looks like this new feature is buggy. I get |
Yes I see that too. I wasn't sure if it was just buggy since it's a relatively new feature or if I didn't understand something. |
If you also think this is a bug, I will file an issue with cpython. |
It’s either a bug or a footgun that ought to be documented. |
Created issue python/cpython#121735 |
this version was in the recent 0.21.0 release and worked fine the irc library is broken (for us) since jaraco/irc@c95c063 the reason is that it uses importlib.resources.files() to import codes and this function is buggy -- it doesn't work with freezed code (see also python/cpython#121735. wimglenn/resources-example#6) and (what a coincidence!) broken implementation of files() function was written by the same person -- see python/cpython#100598
In resources-example/myapp/example5.py Lines 8 to 10 in 8384ded
|
This was a helpful example repo. I just have one request.
In Python 3.12 they updated importlib.resources.files(): https://docs.python.org/3/library/importlib.resources.html#importlib.resources.files
Could you include an example of omitting anchor so that it defaults to the caller’s module (or explicitly passing the module name with a string literal or
__name__
? I tried myself and while it works before packaging with zipapp, it fails to open and read the data file when running the zip. I'm not sure if I'm doing something wrong.The text was updated successfully, but these errors were encountered: