Skip to content
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

Resources not found when nested in zip file #105

Closed
jaraco opened this issue Oct 21, 2020 · 4 comments
Closed

Resources not found when nested in zip file #105

jaraco opened this issue Oct 21, 2020 · 4 comments

Comments

@jaraco
Copy link
Member

jaraco commented Oct 21, 2020

In GitLab by @jaraco on Jun 29, 2020, 12:30

In certifi/python-certifi#131, the user reports that creating a zipfile where the packages are in a subdirectory of the zipfile (e.g. site-packages/pkg), the resources fail to be found with FileNotFoundError('pkg/resource'). It seems that although Python supports paths like local/file.zip/site-packages on sys.path, importlib-resources does not when using the legacy API. When using the files API, those paths are supported.

@jaraco
Copy link
Member Author

jaraco commented Oct 21, 2020

In GitLab by @jaraco on Jun 29, 2020, 12:34

mentioned in commit c970b2d331ac0282aeac49e8ce9f28d3b530bb81

@jaraco
Copy link
Member Author

jaraco commented Oct 21, 2020

In GitLab by @jaraco on Jun 29, 2020, 12:35

mentioned in commit 9403a94

@jaraco
Copy link
Member Author

jaraco commented Oct 21, 2020

In GitLab by @jaraco on Jun 29, 2020, 12:44

In 9403a94, I've created a unit test to capture the expectation. It fails only one test for is_resource, but we know from the upstream issue that the issue is broader (perhaps only on CPython).

Since the files API is not implicated, I'm going to recommend focusing our energy instead on migrating the legacy API to leverage the files API, such as in #80.

@jaraco
Copy link
Member Author

jaraco commented May 4, 2021

Since the files API supports this, I'm not going to invest any additional energy on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant