bug on python plugin?

Discussion about Perl, TCL or Python scripts and C/C++ plugins (using and writing them).

bug on python plugin

Postby marchino » 11 Apr 2006 11:42

hi

when i try to unload and then reload a python which uses gtk, xchat doesn't load it.

this is the code:
Code: Select all
import pygtk
pygtk.require('2.0')
import gtk
import xchat

__module_name__ = 'pygtk'
__module_version__ = '0.0.1'
__module_description__ = 'pygtk test'
__module_author__ = 'marchino'


this is the error message:

Code: Select all
Traceback (most recent call last):
   File "/home/nohero/documents/src/xchat-plugins/pygtk.py", line 3, in ?
    import gtk
  File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 38, in ?
    import gdk # this is created by the _gtk import
ImportError: No module named gdk
Error loading module /home/nohero/documents/src/xchat-plugins/pygtk.py


if i unload and reload the python plugin, then i can reload the script.
but if i unload the python plugin for the second time, then xchat crashes. this is the bt:

Code: Select all
#0  0x0ee2cbd0 in Py_GetArgcArgv () from /usr/lib/libpython2.4.so.1.0
#1  0x0eda9af4 in PyDict_Items () from /usr/lib/libpython2.4.so.1.0
#2  0x0ee2dafc in _PyObject_GC_Del () from /usr/lib/libpython2.4.so.1.0
#3  0x0ee2e664 in PyGC_Collect () from /usr/lib/libpython2.4.so.1.0
#4  0x0ee244c0 in Py_Finalize () from /usr/lib/libpython2.4.so.1.0
#5  0x0e7d8cf8 in xchat_plugin_deinit () at python.c:2152
#6  0x1004b950 in plugin_free (pl=0x30285040, do_deinit=0, allow_refuse=1)
    at plugin.c:142
#7  0x1004baa8 in plugin_kill (name=0x10259370 "Python",
    by_filename=<value optimized out>) at plugin.c:320
#8  0x10026034 in plugingui_unload (wid=<value optimized out>,
    unused=<value optimized out>) at plugingui.c:185
#9  0x0f5e3c64 in g_cclosure_marshal_VOID__VOID ()
   from /usr/lib/libgobject-2.0.so.0
#10 0x0f5d3730 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#11 0x0f5e8058 in g_signal_stop_emission () from /usr/lib/libgobject-2.0.so.0
#12 0x0f5e92c8 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#13 0x0f5e970c in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#14 0x0fce5fe0 in gtk_button_clicked () from /usr/lib/libgtk-x11-2.0.so.0
#15 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#16 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#17 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#18 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#19 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#20 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#21 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#22 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#23 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#24 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#25 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#26 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#27 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#28 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#29 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#30 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#31 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#32 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#33 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#34 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#35 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#36 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#37 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#38 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#39 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#40 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#41 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0
#42 0x0fce8404 in _gtk_button_set_depressed ()
   from /usr/lib/libgtk-x11-2.0.so.0


can you reproduce the error?
is there another way to reload my scripts?
marchino
 
Posts: 1
Joined: 11 Apr 2006 08:41

Postby LoReNzO » 21 Jul 2006 21:13

Hello,
I have the same problem with GDK and XChat... :(
Help me please! :oops:
Thanks a lot! :wink:
LoReNzO
 
Posts: 1
Joined: 21 Jul 2006 21:10

Postby jvdm » 13 Dec 2006 14:03

I'm having the same problem too, is that a real xchat bug?
J. Victor D. Martins | http://jvdm.freeshell.org/
jvdm
 
Posts: 1
Joined: 13 Nov 2006 00:27
Location: São Carlos, São Paulo, Brasil

Postby CohibO » 19 Feb 2008 22:47

I have the same problem too. When I try to load a script which uses the gtk module, this traceback message is returned:

Code: Select all
 Traceback (most recent call last):
   File "/home/claudio/Desktop/progetti/blocker.py", line 8, in <module>
     import gtk
   File "/var/lib/python-support/python2.5/gtk-2.0/gtk/__init__.py", line 50, in <module>
     import gdk
 ImportError: No module named gdk
 Error loading module /home/claudio/Desktop/progetti/blocker.py


Some ideas?
CohibO
 
Posts: 1
Joined: 19 Feb 2008 22:42

Postby netstat » 05 Nov 2008 15:06

I have these problems too.
I can't run my python script with python2.6

Xchat doesnt find re.py, urllib2.py etc.
User avatar
netstat
 
Posts: 82
Joined: 28 Jul 2004 16:58
Location: Germany / Karlsruhe

Rebuild

Postby QwertyManiac » 07 Nov 2008 16:33

The Python plugin needs to be rebuilt against the new 2.6 version of Python. The current one links to an older version I suppose, and thus does not find any modules.

Could be changes within Python 2.6 itself which's the cause, being a ladder up to the more non-backward compatible Python 3.0.
QwertyManiac
 
Posts: 1
Joined: 07 Nov 2008 16:30

Postby Fish-Face » 21 Mar 2010 15:15

Bumping this topic because I have the same problem several years on. To clarify, a script can load gtk fine, but upon reloading the script, this ImportError is thrown.
I get the same behaviour as the OP if I reload the python plugin - first time it works, another time, segfault.

The same behaviour is exhibited if I build xchat myself.
Fish-Face
 
Posts: 4
Joined: 21 Nov 2008 22:09

Re:

Postby chitchattyrap » 18 Mar 2011 14:02

Fish-Face wrote:Bumping this topic because I have the same problem several years on. To clarify, a script can load gtk fine, but upon reloading the script, this ImportError is thrown.
I get the same behaviour as the OP if I reload the python plugin - first time it works, another time, segfault.

The same behaviour is exhibited if I build xchat myself.


This most likely means that what Qwerty said had to happen never happened and the module was never made compatible with the Python upgrades or the bcp software your business is running. i have a feeling this is a bit more about the GTK than the Python. I am by no means guaranteeing you this is the answer, but I feel pretty strongly that I am correct.
Every Time You Come Around My City Bling Bling
User avatar
chitchattyrap
 
Posts: 6
Joined: 17 Mar 2011 17:34


Return to Scripts and Plugins

Who is online

Users browsing this forum: Google [Bot] and 0 guests