Closed jeremyherbert closed 5 years ago
Thanks for reporting @jeremyherbert! For some reason this is hitting a PTK code path, even on readline, and you are on a very old version of PTK. Can you upgrade or uninstall your PTK version?
I just upgraded PTK to the latest pip version, but no change unfortunately.
$ pip3 install --upgrade ptk
Collecting ptk
Downloading https://files.pythonhosted.org/packages/af/84/91ee1800ebabd3a3884712b016fa3365436846e7de76a84cacd223b60ca5/ptk-1.3.6.tar.gz (244kB)
|████████████████████████████████| 245kB 2.5MB/s
Building wheels for collected packages: ptk
Building wheel for ptk (setup.py) ... done
Stored in directory: /Users/jeremy/Library/Caches/pip/wheels/3b/ae/82/2de88d69bdefec51f7bf2a0b2f99d406ec410afaff66a8ab82
Successfully built ptk
Installing collected packages: ptk
Successfully installed ptk-1.3.6
traceback:
Traceback (most recent call last):
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/xonsh/main.py", line 402, in main
return main_xonsh(args)
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/xonsh/main.py", line 431, in main_xonsh
shell.shell.cmdloop()
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/xonsh/ptk/shell.py", line 176, in cmdloop
line = self.singleline(auto_suggest=auto_suggest)
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/xonsh/ptk/shell.py", line 141, in singleline
pyghooks.xonsh_style_proxy(self.styler)
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/prompt_toolkit/styles/from_pygments.py", line 64, in __new__
return style_from_dict(pygments_style_cls.styles)
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/prompt_toolkit/styles/from_dict.py", line 124, in style_from_dict
attrs = attrs._replace(color=_colorformat(part))
File "/Users/jeremy/anaconda3/lib/python3.6/site-packages/prompt_toolkit/styles/from_dict.py", line 39, in _colorformat
raise ValueError('Wrong color format %r' % text)
ValueError: Wrong color format 'ansibrightblack'
Xonsh encountered an issue during launch
Failback to /bin/bash
xonfig (from readline):
+------------------+---------------------+
| xonsh | 0.9.8 |
| Git SHA | cb485817 |
| Commit Date | Jul 1 20:35:24 2019 |
| Python | 3.6.8 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 1.0.15 |
| shell type | readline |
| pygments | 2.4.2 |
| on posix | True |
| on linux | False |
| on darwin | True |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
+------------------+---------------------+
FWIW, I also tried uninstalling PTK, but the same problem occurs.
aha, fixed. I saw that the prompt_toolkit version did not change in the xonfig. I had an older version of jupyter-console (and ipython), which was holding back the prompt_toolkit package. Upgrading all of these allowed me to upgrade prompt_toolkit and then everything is back to normal. Thank you for your help!
awesome!
This appears to be similar to #2780. I'm getting the following traceback when starting
xonsh --no-rc
This is after upgrading to the latest version of xonsh (from pip3) to try and fix this traceback:
xonfig
I can only get this by running xonsh with
--shell-type=readline
as per #2780 :XONSH_DEBUG=1
does not change the output. I'm honestly at a loss of what I could have changed to trigger this (but I'm sure I did something...)