Load schemas via importlib.resources instead of pkgutil #871
Labels
Enhancement
Some new desired functionality
Help Wanted
An enhancement or bug for which a pull request is welcomed and which should have a clear definition.
Producing binaries that embed Python applications that import jsonschema is challenging because
pkgutil.get_data
relies on__file__
which may not be always defined, e.g. see these issues in PyOxidizer.https://github.com/Julian/jsonschema/blob/272b4f24437d9cba1127058dc3479f9bc6d8c4b9/jsonschema/_utils.py#L49-L55
I was wondering if this project would be interested in having a fallback implemented that is capable to load the schema files using
importlib.resources
instead, which was added in Python 3.7. See https://stackoverflow.com/a/20885799 for more details. The creator of PyOxidizer, Gregory Szorc, shares some good details on loading resource files using PyOxidizer here.The text was updated successfully, but these errors were encountered: