Skip to content
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

Powerline fails with 'Unknown environment variable: $0' #20

Open
StreakyCobra opened this issue Oct 8, 2018 · 6 comments
Open

Powerline fails with 'Unknown environment variable: $0' #20

StreakyCobra opened this issue Oct 8, 2018 · 6 comments

Comments

@StreakyCobra
Copy link

Hi,

After upgrading xonsh this morning (version xonsh/xonsh@aca294b), powerline is not working any longer. Here is the trackeback of the error:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/xonsh/proc.py", line 1696, in wait
    r = self.f(self.args, stdin, stdout, stderr, spec, spec.stack)
  File "/usr/lib/python3.7/site-packages/xonsh/proc.py", line 1197, in proxy_two
    return f(args, stdin)
  File "/usr/lib/python3.7/site-packages/xonsh/xontribs.py", line 178, in xontribs_main
    return _MAIN_XONTRIB_ACTIONS[ns.action](ns)
  File "/usr/lib/python3.7/site-packages/xonsh/xontribs.py", line 98, in _load
    xontribs_load(ns.names, verbose=ns.verbose)
  File "/usr/lib/python3.7/site-packages/xonsh/xontribs.py", line 90, in xontribs_load
    update_context(name, ctx=ctx)
  File "/usr/lib/python3.7/site-packages/xonsh/xontribs.py", line 69, in update_context
    modctx = xontrib_context(name)
  File "/usr/lib/python3.7/site-packages/xonsh/xontribs.py", line 33, in xontrib_context
    m = importlib.import_module(spec.name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/fabien/.local/lib/python3.7/site-packages/xontrib/powerline.xsh", line 223, in <module>
    pl_build_prompt()
  File "/home/fabien/.local/lib/python3.7/site-packages/xontrib/powerline.xsh", line 213, in pl_build_prompt
    if varname not in __xonsh_env__:
  File "/usr/lib/python3.7/site-packages/xonsh/built_ins.py", line 1468, in __getitem__
    return self.obj.__getitem__(item)
  File "/usr/lib/python3.7/site-packages/xonsh/environ.py", line 1154, in __getitem__
    raise KeyError(e.format(key))
KeyError: 'Unknown environment variable: $0'

Let me know if you need more information!

@t11em
Copy link

t11em commented Oct 31, 2018

It was solved by reflecting this pull request

@StreakyCobra
Copy link
Author

@t11em Indeed this seems to fix the issue, thanks for the link! Applied locally, waiting for it to be merged :-)

@santagada
Copy link
Owner

thanks, I merged the PR, later this week will do another release

@gdoenlen
Copy link

gdoenlen commented Jan 8, 2019

@santagada did you get around to releasing this? receiving this on a new install today.

edit: added the error

xontrib\powerline.xsh:213: DeprecationWarning: __xonsh_env__ has been deprecated, please use __xonsh__.env instead.
  if varname not in __xonsh_env__:
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
KeyError: 'Unknown environment variable: $0'

@stharding
Copy link

Just tried a fresh install of xonsh and this. This is still an issue. Is the pull request mentioned by @t11em going to be merged?

@stharding
Copy link

Oops, I didn't read carefully enough. I see that this pr is merged. @santagada was that release ever done?

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

No branches or pull requests

5 participants