It appears the use of __file__ here is mostly unnecessary, and can easily be replaced with importlib.resources/pkgutil. See indygreg/PyOxidizer#69 for more info about why, but the tl;dr version is __file__ is an optional attribute and should not be relied upon.
Loading of resources from the runtime package should ideally be done using importlib.resources and backport importlib_resources, however pkgutil could be used to avoid the need for the backport. Using pkgutil doesn't work under PyOxidizer 0.4, however I expect that will be fixed soon.
It appears the use of
__file__here is mostly unnecessary, and can easily be replaced withimportlib.resources/pkgutil. See indygreg/PyOxidizer#69 for more info about why, but the tl;dr version is__file__is an optional attribute and should not be relied upon.Loading of resources from the runtime package should ideally be done using
importlib.resourcesand backportimportlib_resources, howeverpkgutilcould be used to avoid the need for the backport. Usingpkgutildoesn't work under PyOxidizer 0.4, however I expect that will be fixed soon.