Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error with apertium-tolk every time a non-asci character is keyed:
- org.freedesktop.DBus.Python.UnicodeEncodeError: Traceback (most recent call last):
- File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
- retval = candidate_method(self, *args, **keywords)
- File "/usr/share/apertium/dbus-1/mode.py", line 61, in translate
- return translate.translate(self.mode, options, text)
- File "/usr/share/apertium/dbus-1/mode.py", line 46, in translate
- out, err = call(add_options([self.cmd, pair], options), text)
- File "/usr/share/apertium/dbus-1/command_line.py", line 13, in call
- child_in.write(_in)
- UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128)
- These are the solutions I tested:
- - i tryed to edit /usr/bin/python2.7 which is the file to which /usr/bin/python2 links .... but this file is binary
- - /usr/lib/python2.7/sitecustomize.py points to /etc/python2.7/sitecustomize.py and this file has content already so I didn't edit it:
- # install the apport exception handler if available
- try:
- import apport_python_hook
- except ImportError:
- pass
- else:
- apport_python_hook.install()
- - I created a the files /usr/lib/python2.7/site-packages/sitecustomize.py and /usr/lib/python2.5/site-packages/sitecustomize.py and ~/-local/sitecustomize.py with the following text:
- # sitecustomize.py
- # this file can be anywhere in your Python path,
- # but it usually goes in ${pythondir}/lib/site-packages/
- import sys;
- sys.setdefaultencoding('utf-8');
- None worked.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement