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

Ascii codec printing ordinal not in range(128) #343

Closed
omarchehab98 opened this issue Dec 25, 2017 · 4 comments
Closed

Ascii codec printing ordinal not in range(128) #343

omarchehab98 opened this issue Dec 25, 2017 · 4 comments

Comments

@omarchehab98
Copy link

omarchehab98 commented Dec 25, 2017

This issue was directly addressed by #211, however, I have not been able to find a fix for this.

When changing directories into a directory with git, the pencil character is drawn

Traceback (most recent call last):
  File "/home/omar/.local/bin/powerline-shell", line 11, in <module>
    sys.exit(main())
  File "/home/omar/.local/lib/python3.5/site-packages/powerline_shell/__init__.py", line 206, in main
    sys.stdout.write(powerline.draw())
UnicodeEncodeError: 'ascii' codec can't encode character '\u270e' in position 546: ordinal not in range(128)
$  python3 --version
Python 3.5.3

$  pip show powerline-shell
Name: powerline-shell
Version: 0.4.5
Summary: A pretty prompt for your shell
Home-page: https://github.com/banga/powerline-shell
Author: Buck Ryan
Author-email: UNKNOWN
License: UNKNOWN
Location: /home/omar/.local/lib/python3.5/site-packages
Requires: argparse

$  uname -a
Linux omar 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux

As a temporary fix, I removed git from segments in .powerline-shell.json.

@omarchehab98 omarchehab98 changed the title Ascii codec issue Ascii codec printing ordinal not in range(128) Dec 25, 2017
@b-ryan
Copy link
Owner

b-ryan commented Feb 24, 2018

Sorry for the delay! This sounds similar to #229 - I am curious if the suggestion in there fixes this, specifically, setting:

export PYTHONIOENCODING=UTF-8

In your bashrc before the call to powerline-shell.

@b-ryan
Copy link
Owner

b-ryan commented Apr 21, 2018

Since it's been over a month since my previous comment, going to close this. Feel free to re-open if needed!

@b-ryan b-ryan closed this as completed Apr 21, 2018
@eightnoteight
Copy link

for anyone in future who gets here like myself, exporting PYTHONIOENCODING fixed the issue for me

@rklasen
Copy link

rklasen commented Mar 25, 2019

@eightnoteight thanks, this fixed the issue for me as well. Specifically, export PYTHONIOENCODING='utf8'. This was necessary after issue #408 started appearing today.

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

4 participants