amoikevin / libgooglepinyin

Automatically exported from code.google.com/p/libgooglepinyin
0 stars 0 forks source link

engine.py中179行的报错 #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.使用golang语言编译一个go-gtk的界面程序(比如go-gtk的示例程
序)
2.googlepinyin切换为英文模式
3.输入字符后回车,会提示错误

What is the expected output? What do you see instead?

(setargs:3850): IBUS-WARNING **: Process Key Event failed: 
GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code36: 
GDBus.Error:org.freedesktop.DBus.Python.ValueError: 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/lib/python2.7/dist-packages/ibus/engine.py", line 188, in ProcessKeyEvent
    return self.__engine.process_key_event(keyval, keycode, state)
  File "/usr/share/ibus-googlepinyin/engine.py", line 179, in process_key_event
    if ascii.isprint(chr(keyval)) and self.__full_width_letter[self.__mode] :
ValueError: chr() arg not in range(256)

What version of the product are you using? On what operating system?

Ubuntu 12.04 ;ibus 1.4.1 ;ibus-googlepinyin 0.1.1+hg20111212-1

Please provide any additional information below.

if ascii.isprint(chr(keyval)) and self.__full_width_letter[self.__mode] :
修改为:
if keyval<256 and ascii.isprint(chr(keyval)) and 
self.__full_width_letter[self.__mode] :

Original issue reported on code.google.com by weizh...@gmail.com on 7 Jun 2012 at 6:17