Closed santagada closed 8 years ago
What did you run right before this? And how did you start xonsh?
What's your LOCALE/LANG/LC_* variables? Are you using unicode in your source or \u
/\U
/\N
escapes?
Is this fixed by #1471?
I agree with @astronouth7303 that this seems like it is related to the other issue.
using master from right now and xon.sh I still see:
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
File "/Users/santagada/devel/xonsh/xonsh/proc.py", line 349, in wrapped_simple_command
r = f(args, i)
File "/Users/santagada/devel/xonsh/xonsh/aliases.py", line 257, in source_alias
builtins.execx(fp.read(), 'exec', builtins.__xonsh_ctx__)
File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 397: ordinal not in range(128)
santagada@appletart ~ $
but if I start xonsh right after it it both doesn't print an exception and has my prompt (and not xonsh default one as the message up)
I tried changing xon.sh to my LANG/LC_ALL values:
#!/bin/sh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# run python
/usr/bin/env PYTHONUNBUFFERED=1 /usr/local/bin/python3 -u -m xonsh $@
but it didn't help.
If I try to load my prompt function on the first Xonsh it always gives the same error and switches it back to default:
$ source prompt.xsh
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
File "/Users/santagada/devel/xonsh/xonsh/proc.py", line 349, in wrapped_simple_command
r = f(args, i)
File "/Users/santagada/devel/xonsh/xonsh/aliases.py", line 257, in source_alias
builtins.execx(fp.read(), 'exec', builtins.__xonsh_ctx__)
File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 397: ordinal not in range(128)
This is probably because the source alias is not passing in $XONSH_ENCODING
and errors into the open() call https://github.com/xonsh/xonsh/blob/master/xonsh/aliases.py#L256
Yes I have unicode literals in that file. Is it easy for you to fix?
Ahh yes, this is easy for me to fix.
See #1519
On xterm inside xquartz (os x X11 server):
I think it is on running my $PROMPT function, but maybe it is an app I run on login (archey)