On Mon, 17 Sep 2001, Tom Cato Amundsen wrote:

> Can someone that has installed gtk+ 1.3.7 and pygtk-1.99 test
> this little script and see if it segfaults? I'm still
> unsure if this is a local problem or a bug.
>
> import sys
> # edit this!!!
> sys.path.insert(0, "/home/tom/gtk2/lib/python2.0/site-packages")
> import gtk
>
> class VClass:
>     def __init__(self):
>         pass
>
> class MWin(gtk.GtkWindow, VClass):
>     def __init__(self):
>         gtk.GtkWindow.__init__(self, gtk.WINDOW_TOPLEVEL)
>         VClass.__dict__['__init__'](self)
>         print "Prepare to segfault"
>         a = self.b
>         print "You'll never get here!"
>
> w = MWin()
>

I have worked out what is causing this crash.  It is not handling VClass
correctly in the getattr routine in gobjectmodule isn't checking for non
ExtensionClass instances.

Try applying this patch:
Index: gobjectmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gobjectmodule.c,v
retrieving revision 1.45
diff -u -p -r1.45 gobjectmodule.c
--- gobjectmodule.c     2001/09/15 02:59:54     1.45
+++ gobjectmodule.c     2001/09/18 02:10:23
@@ -1085,7 +1085,7 @@ check_bases(PyGObject *self, PyExtension
        else
            PyErr_Clear();
     }
-    if (class->bases) {
+    if (PyExtensionClass_Check(class) && class->bases) {
        guint i, len = PyTuple_Size(class->bases);

        for (i = 0; i < len; i++) {

Applying that patch should fix the problem.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to