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

UnicodeDecodeError on "set" command #24

Closed
NullNoname opened this issue Feb 12, 2014 · 2 comments
Closed

UnicodeDecodeError on "set" command #24

NullNoname opened this issue Feb 12, 2014 · 2 comments

Comments

@NullNoname
Copy link

I'm using Ubuntu 13.10. The "set" command crashes whole program no matter what:

Traceback (most recent call last):
File "/usr/local/bin/pmsyt", line 2033, in
main()
File "/usr/local/bin/pmsyt", line 2028, in main
screen_update()
File "/usr/local/bin/pmsyt", line 876, in screen_update
print(py2utf8_encode(g.content))
File "/usr/local/bin/pmsyt", line 69, in
py2utf8_encode = lambda x: x.encode("utf8")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 206: ordinal not in range(128)

@NullNoname
Copy link
Author

Never mind... I just forgot to set the system encoding to UTF-8 in Python.

$ sudo nano /usr/lib/python2.7/sitecustomize.py
Added the following at the bottom of the file:
import sys
sys.setdefaultencoding('utf-8')

Sorry for sending wrong issue report.

@np1
Copy link
Contributor

np1 commented Feb 12, 2014

Glad you sorted it. Could you tell me why you needed to set pythons defualt encoding in sitecustomize.py? Are you using a localised version of Ubuntu? I have never needed to do that. There is a similar issue reported here that I am trying to help resolve https://github.com/np1/pms/issues/45

@np1 np1 added the resolved label Feb 13, 2014
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

2 participants