Skip to content

Avoid failing if __file__ doesnt exist / PyOxidizer support #25

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

Closed
jayvdb opened this issue Nov 13, 2019 · 1 comment · Fixed by #30
Closed

Avoid failing if __file__ doesnt exist / PyOxidizer support #25

jayvdb opened this issue Nov 13, 2019 · 1 comment · Fixed by #30

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Nov 13, 2019

PyOxidizer breaks on stdlib-list as it doesnt provide __file__ 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.

e.g. at the moment this is what it looks like

>>> import depfinder
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "depfinder", line 34, in <module>
  File "depfinder.main", line 41, in <module>
  File "stdlib_list", line 6, in <module>
  File "stdlib_list.base", line 6, in <module>
NameError: name '__file__' is not defined
@ocefpaf
Copy link
Contributor

ocefpaf commented Nov 13, 2019

I never used PyOxidizer before. Good to know. Do you want to send a PR?

jayvdb added a commit to jayvdb/python-stdlib-list that referenced this issue Dec 22, 2019
`__file__` is an optional attribute which isnt available in zipapps
and PyOxidizer.  Use pkgutil.get_data instead.

Closes pypi#25
jayvdb added a commit to jayvdb/python-stdlib-list that referenced this issue Dec 22, 2019
`__file__` is an optional attribute which isnt available in zipapps
and PyOxidizer.  Use pkgutil.get_data instead.

Closes pypi#25
jayvdb added a commit to jayvdb/python-stdlib-list that referenced this issue Dec 22, 2019
`__file__` is an optional attribute which isnt available in zipapps
and PyOxidizer.  Use pkgutil.get_data instead.

Closes pypi#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants