edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.2k stars 70 forks source link

Exception when encountering u'\u2192' character #73

Closed JLLeitschuh closed 5 years ago

JLLeitschuh commented 5 years ago

The u2192 character is not supported.

Traceback (most recent call last):
  File "/Users/jonathanleitschuh/.local/share/omf/pkg/bass/functions/__bass.py", line 99, in <module>
    print(script, end='')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2192' in position 168: ordinal not in range(128)
edc commented 5 years ago

You have a unicode arrow character ("→") in your environment, maybe to show cute bash prompt? Either remove it, or edit the mentioned line from

print(script, end='')

to the following:

print(script.encode('utf8'), end='')

Hope that works.

JLLeitschuh commented 5 years ago

Any plans to update the script to support it or would a PR be useful here?

edc commented 5 years ago

Let me if the fix works? If it does, I can include it. Feel free to submit a PR too.

JLLeitschuh commented 5 years ago

Haven't had the cycles to try this yet, sorry.