-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Avoid use of __file__ #7011
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is still valid: The first two are runtime use of
|
This issue has been automatically marked as not stale anymore due to the recent activity. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it had not recent activity during the stale period. |
ping @ndeloof , can you re-open |
Let me reopen. Looks like you have a fair understanding of what changes need to be made; were you considering opening a pull request with those changes? |
This issue has been automatically marked as not stale anymore due to the recent activity. |
1 similar comment
This issue has been automatically marked as not stale anymore due to the recent activity. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still a problem
However PyOxidizer now supports pkgutil, so that is now an easy and backwards compatible way to solve these |
This issue has been automatically marked as not stale anymore due to the recent activity. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue now redundant. |
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.resources
and backportimportlib_resources
, howeverpkgutil
could be used to avoid the need for the backport. Usingpkgutil
doesn't work under PyOxidizer 0.4, however I expect that will be fixed soon.The text was updated successfully, but these errors were encountered: