After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 613331 - keymap.get_entries_for_keyval returns None when run inside an nxserver
keymap.get_entries_for_keyval returns None when run inside an nxserver
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: X11
2.18.x
Other Linux
: Normal critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-19 15:29 UTC by michael perigard
Modified: 2018-02-10 03:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description michael perigard 2010-03-19 15:29:31 UTC
Ubuntu 9.10

python-gtk2 2.16.0-0ubuntu1
freenx-server: 0.7.3+teambzr104-0ubuntu1~karmic1

michael@frigg:~$ python
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
keyXlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
ma>>> keymap = gtk.gdk.keymap_get_default()
>>> print gtk.keysyms.Insert, keymap.get_entries_for_keyval(gtk.keysyms.Insert)
65379 None
>>>

This may be an xlib bug, this may be a freenx bug, this may be a gtk or pygtk bug... This is when running an X session with freenx-server and connecting remotely. If I ssh to the machine, export my display to :0 (even though the machine is in a headless vm) and run the same test, it returns a proper value. I'm filing the bug under pygtk since that's the highest level package I can think of. This is causing gajim (as of the latest development versions) to crash on startup, with the traceback pointing to the keymap.get_entries_for_keyval command.
Comment 1 michael perigard 2010-03-19 17:55:29 UTC
This happens not only with freenx-server 0.7.3 found in the freenx launchpad ppa, but with Google's 'neatx' nxserver (0.3.1 from the freenx launchpad ppa) as well.
Comment 2 John Ehresman 2010-03-19 17:57:24 UTC
I suspect it's not a pygtk bug, but rather it's lower level in gdk or below
Comment 3 michael perigard 2010-03-19 18:47:41 UTC
(In reply to comment #2)
> I suspect it's not a pygtk bug, but rather it's lower level in gdk or below

Any suggestions about where to move/re-file/re-classify the bug to get it in front of someone else's eyes? I'm currently plowing through the dozens of possible duplicate bugs on the gnome bugzilla but I'm not holding my breath...

Same result with No Machine's commercial nxserver, for anyone keeping score. The nxserver obviously has something to do with it, and it doesn't matter whose nxserver implementation we use.
Comment 4 michael perigard 2010-03-19 19:18:54 UTC
sorry, now that I've moved this to gtk:
libgtk2.0-0:  2.18.3-1ubuntu2.2
Comment 5 Matthias Clasen 2010-03-20 04:34:51 UTC
Sounds like these X servers might have buggy xkb implementations.
Your best bet is to step though gdk_keymap_get_entries_for_keycode
in a debugger and see what is going on.
Comment 6 michael perigard 2010-03-31 20:58:58 UTC
sorry, I could have included the traceback. Here's my attempt at debugging:

Traceback (most recent call last):
  • File "/usr/lib/python2.6/pdb.py", line 1283 in main
    pdb._runscript(mainpyfile)
  • File "/usr/lib/python2.6/pdb.py", line 1202 in _runscript
    self.run(statement)
  • File "/usr/lib/python2.6/bdb.py", line 368 in run
    exec cmd in globals, locals
  • File "<string>", line 1 in <module>
  • File "gajim.py", line 213 in <module>
    import gtkexcepthook
  • File "/usr/share/gajim/src/gtkexcepthook.py", line 31 in <module>
    import dialogs
  • File "/usr/share/gajim/src/dialogs.py", line 41 in <module>
    import disco
  • File "/usr/share/gajim/src/disco.py", line 59 in <module>
    import search_window
  • File "/usr/share/gajim/src/search_window.py", line 30 in <module>
    import config
  • File "/usr/share/gajim/src/config.py", line 45 in <module>
    import chat_control
  • File "/usr/share/gajim/src/chat_control.py", line 92 in <module>
    class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
  • File "/usr/share/gajim/src/chat_control.py", line 99 in ChatControlBase
    keycode_ins = keymap.get_entries_for_keyval(gtk.keysyms.Insert)[0][0]
TypeError: 'NoneType' object is unsubscriptable
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /usr/share/gajim/src/chat_control.py(99)ChatControlBase()->None
-> keycode_ins = keymap.get_entries_for_keyval(gtk.keysyms.Insert)[0][0]
(Pdb) l
 94  	    A base class containing a banner, ConversationTextview, MessageTextView
 95  	    """
 96  	
 97  	    keymap = gtk.gdk.keymap_get_default()
 98  	    keycode_c = keymap.get_entries_for_keyval(gtk.keysyms.c)[0][0]
 99  ->	    keycode_ins = keymap.get_entries_for_keyval(gtk.keysyms.Insert)[0][0]

and the output that confused the gajim developer ('that shouldn't return None!')

michael@frigg:~$ python
Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
>>> keymap = gtk.gdk.keymap_get_default()
>>> print gtk.keysyms.Insert, keymap.get_entries_for_keyval(gtk.keysyms.Insert)
65379 None
>>>

please let me know what other information I can provide.
Comment 7 Pierre Carru 2010-04-19 22:26:18 UTC
Hi,

Have you installed the xkb-data package?
I have just had a similar issue with xpra because that package was missing it was missing.

Also when you run python manually be sure to choose the right X server using the DISPLAY variable.
"$ python" and "$ DISPLAY=:5 python" won't give the same results

Cheers,
Pierre
Comment 8 michael perigard 2010-04-29 08:47:19 UTC
I do have the xkb-data package installed, which provides the xkb rules you mention on the gajim bug tracker ( http://trac.gajim.org/ticket/5636 ).

Yes, I do run python from a terminal within the remote desktop. If I connect with a terminal program to run the test, I make sure to export the DISPLAY variable to one the nx server session. 

It's interesting to note that if I export my DISPLAY variable to the :0 display (which just constantly runs gdm on my vm), the python test returns a sane value every time.

I have been noticing that, since upgrading to ubuntu 10, this error is intermittent. I'll try to track down the differences between when it works and when it doesn't, but I haven't noticed them yet. For example, gajim works, the python test returns a sane response instead of an error, I reboot the vm without upgrading any pacakges, and gajim will no longer work, and the python test will return the error above.
Comment 9 Matthias Clasen 2018-02-10 03:43:06 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.