标签:unicodedecodeerror: 'ascii' codec can't decode byte 0xe3 in position 5: ordinal not in range(128)
报错信息如下
root#salt-key -L
Traceback (most recent call last):
File "/usr/bin/salt-key", line 10, in <module>
salt_key()
File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 78, in salt_key
client.run()
File "/usr/lib/python2.6/site-packages/salt/cli/__init__.py", line 358, in run
key.run()
File "/usr/lib/python2.6/site-packages/salt/key.py", line 390, in run
self.list_all()
File "/usr/lib/python2.6/site-packages/salt/key.py", line 85, in list_all
self.opts)
File "/usr/lib/python2.6/site-packages/salt/output/__init__.py", line 44, in display_output
display_data = get_printout(out, opts)(data).rstrip()
File "/usr/lib/python2.6/site-packages/salt/output/key.py", line 83, in output
color[‘ENDC‘])
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe3 in position 5: ordinal not in range(128)
解决方法:
vim /usr/lib/python2.6/site-packages/salt/output/key.py
加入如下
import sys
reload(sys)
sys.setdefaultencoding(‘utf8‘)
标签:unicodedecodeerror: 'ascii' codec can't decode byte 0xe3 in position 5: ordinal not in range(128)
原文地址:http://rotbn.blog.51cto.com/3001058/1616057