Author William.Schwartz
Recipients William.Schwartz, barry, jaraco
Date 2021-01-11.21:00:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610398816.0.0.119807248287.issue42531@roundup.psfhosted.org>
In-reply-to
Content
> For that, please submit a PR to importlib_resources and it will get synced to CPython later.

Will do once PR 23611 gets in shape. 

> Can you tell me more about the use-case that exhibited this undesirable behavior?

Using the [PyOxidizer] "freezer". It compiles Python together with frozen Python code or byte code.

> That is, what loader is it that supports `open_binary` but not `is_resource` and doesn't have a `__origin__`?

PyOxidizer's [OxidizedImporter] importer. It [does not set `__file__`] (i.e., `__spec__.origin__ is None`). Its maintainer has resolved some ambiguities in the resources API contract (#36128) [differently from CPython], but I don't think that's related to the issue I ran into. The resource-related functionality of the importer is implemented here (extension module written in Rust): https://github.com/indygreg/PyOxidizer/blob/e86b2f46ed6b449bdb912900b0ac83576ad5ebe9/pyembed/src/importer.rs#L1078-L1269

[PyOxidizer]: https://pyoxidizer.readthedocs.io
[OxidizedImporter]: https://pyoxidizer.readthedocs.io/en/v0.10.3/oxidized_importer.html
[does not set `__file__`]: https://pyoxidizer.readthedocs.io/en/v0.10.3/oxidized_importer_behavior_and_compliance.html#file-and-cached-module-attributes
[unsure about `ResourceReader` semantics]: https://pyoxidizer.readthedocs.io/en/v0.10.3/oxidized_importer_resource_files.html#resource-reader-support
History
Date User Action Args
2021-01-11 21:00:16William.Schwartzsetrecipients: + William.Schwartz, barry, jaraco
2021-01-11 21:00:16William.Schwartzsetmessageid: <1610398816.0.0.119807248287.issue42531@roundup.psfhosted.org>
2021-01-11 21:00:15William.Schwartzlinkissue42531 messages
2021-01-11 21:00:15William.Schwartzcreate