Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unable to load resources for modules #203

Copy link
Copy link
@jaraco

Description

@jaraco
Issue body actions

In #60, I encountered an issue where importlib resources was unable to supply an interface for modules that wish to load neighboring resources. I've encountered another use-case where it's not straightforward to replace the pkg_resources usage with importlib.resources.

Again, in this case, because the test module isn't in a package, importlib resources doesn't support it, but pkg_resources does. The current workarounds include:

  • make the tests directory a proper package. However, doing this also causes that package to get discovered as a package.
  • assume the files are on a local file system and access __file__ to infer the location of nearby resources.

In my opinion, if 'importlib' supports importing non-package modules, 'importlib resources' should support loading resources pertinent to those modules.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.