-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Cannot create a path from a zipped resource with Python 3.6 #64
Comments
In GitLab by @Dan737 on Jul 4, 2018, 03:06 changed the description |
In GitLab by @Dan737 on Jul 4, 2018, 03:07 changed the description |
In GitLab by @pauleveritt on Jul 12, 2018, 08:49 I also have a project that wants to use importlib targeting Python 3.6, with wheels. |
In GitLab by @warsaw on Jul 12, 2018, 14:58 This should definitely work. |
In GitLab by @Dan737 on Jul 13, 2018, 04:50 Thanks for taking the time to look into this. Here are the minimal steps I could find to reproduce the problem. Create a directory with the following structure:
setup.py
dist/get_resource.py
Initially, run On Python 3.6, I get the following Traceback:
On Python 3.7 it works with the following output:
|
In GitLab by @warsaw on Aug 16, 2018, 02:39 Actually, the problem is in Python 3.6 and we cannot fix it here. Nor can we fix it in 3.6 without breaking backward compatibility. Here's the problem: In 3.6, if you add the zip/whl to If you change the code in I'll keep this bug open but change the labels. We should document this peculiarity. |
In GitLab by @warsaw on Sep 7, 2018, 18:50 mentioned in merge request !65 |
In GitLab by @warsaw on Sep 7, 2018, 18:56 closed via merge request !65 |
In GitLab by @Dan737 on Jul 3, 2018, 12:13
I'm using Python 3.6.4. I'm trying to access a resource in a whl file. Using the following code:
This leads to a
FileNotFoundError: [Errno 2] No such file or directory
error.I tried a couple of things and I figured out that the imported package has a
loader=<zipimporter object>
. But this object does not have anyget_resource_reader
method.I noticed that in Python 3.7 this method is now defined on zipimporter class. So my question is basically: can we use this backport for zipped files with Python less than 3.7?
The text was updated successfully, but these errors were encountered: