Open andrii482 opened 3 years ago
Hello, I also confirmed the issue in iTerm2.
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/site-packages/xonsh/xontribs.py", line 89, in xontribs_load
update_context(name, ctx=ctx)
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/site-packages/xonsh/xontribs.py", line 72, in update_context
modctx = xontrib_context(name)
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/site-packages/xonsh/xontribs.py", line 37, in xontrib_context
m = importlib.import_module(spec.name)
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/site-packages/xontrib/powerline2.xsh", line 307, in <module>
pl_build_prompt()
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/site-packages/xontrib/powerline2.xsh", line 295, in pl_build_prompt
add_section($PL_EXTRA_SEC)
File "/Users/tsano/.pyenv/versions/3.8.7/lib/python3.8/site-packages/xontrib/powerline2.xsh", line 248, in add_section
for name, section in new_sec.items():
AttributeError: 'str' object has no attribute 'items'
Failed to load xontrib powerline2.
When this problem occurs in my environment (xonsh version: 0.9.25), the type of $PL_EXTRA_SEC
is not dict
, but str
, as shown below.
tsano@Mac ~ $ $PL_EXTRA_SEC
"{'user': <function <lambda> at 0x110eee0d0>}"
tsano@Mac ~ $ type($PL_EXTRA_SEC)
str
@tsano430 @andrii482 Thanks your reports.
It seems to be a bug in 1.5.0. We will fix it soon, so please use the following for a while.
xontrib-powerline2<=1.4.0
xontrib-powerline2<=1.4.0
It may be that my environment is unique, but it still doesn't work properly.
When 'PL_EXTRA_SEC' not in ${...}
is false, it seems that I encounter the issue.
check running
$ pip list | grep xon
xonsh 0.9.25.dev3
xontrib-powerline2 1.3.0
🤔
Thank you for your comment. In my environment, the following result is obtained.
@tsano430 @andrii482 Thanks.
I need to add more information. I brought the environment closer to you but It didn't reappear.
- OS
- python version
- xonsh version
- xontrib-powerline2 version
- xonshrc
Do you have any other information about recent updates to Xonsh? It helps a lot!
The behavior in my environment is the same as the figure above. However, I have the problem afterwards when I run the command xonsh
on xonsh.
On bash shell: xonsh
command -> xontrib load powerline2
command -> xonsh
command -> xontrib load powerline2
command -> Error arises
Another example: https://gist.github.com/tsano430/d4df212ce2f70fada904ed7c8b0fc901
This depends on the functionality of xonsh, so I wrote issue in xonsh.
I have the same problem trying to run xontrib load powerline2
╰─ $ xontrib load powerline2
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/xontribs.py", line 89, in xontribs_load
update_context(name, ctx=ctx)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/xontribs.py", line 72, in update_context
modctx = xontrib_context(name)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/xontribs.py", line 37, in xontrib_context
m = importlib.import_module(spec.name)
File "/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 786, in exec_module
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/imphooks.py", line 123, in get_code
code = execer.compile(src, glbs=ctx, locs=ctx)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/execer.py", line 135, in compile
tree = self.parse(input, ctx, mode=mode, filename=filename, transform=transform)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/execer.py", line 95, in parse
tree, input = self._parse_ctx_free(input, mode=mode, filename=filename)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/execer.py", line 219, in _parse_ctx_free
tree = self.parser.parse(
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/parsers/base.py", line 497, in parse
tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/ply/ply/yacc.py", line 335, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/ply/ply/yacc.py", line 1122, in parseopt_notrack
p.callable(pslice)
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/parsers/base.py", line 2253, in p_atom_expr
p[0] = self.apply_trailers(p[1], p[2])
File "/usr/local/Cellar/xonsh/0.9.26/libexec/lib/python3.9/site-packages/xonsh/parsers/base.py", line 2247, in apply_trailers
assert False
AssertionError
Failed to load xontrib powerline2.
There seems to be multiple problems, so we'll research.
I get this in the VS Code terminal but not in Konsole. Is there a workaround?
I also get this in VS Code terminal, but not on iterm
issue found in Yakuake terminal