[pygtk] Pygtk Crashes Everywhere

Matí­as Alejandro Torres torresmat at gmail.com
Wed Apr 2 21:49:34 WST 2008


Hi,

    I've been working in a PyGTK application. This application works 
great in Linux but in Windows it crashes randomly. Threads are used in 
the application but only at the beggining  to load data and no 
modification to the GUI is done from other than the main thread. I'm 
using pysqlite as database engine.

    The application crashes for example when:
   

    *This is executed:
             date = datetime.date (year, month, day)

             year, month and day are in the specified range. The 
execution of the program does not goes beyond this function.

    *This is executed:
             entry.set_text (patient.firstname or '')

    It seems a programming error is affecting the entire stability of 
the program, but don't know what it might be. I initialize the program 
this way:

#############
import gobject

import gc
import pygtk
import gtk
import logging

from gui.consultoriowindow import ConsultorioWindow
from consultoriocontroller import ConsultorioController

gobject.threads_init ()
gtk.gdk.threads_init ()

gc.enable ()

#Logging
logging.basicConfig(level=logging.INFO,
            format='%(asctime)s %(levelname)s %(message)s')
logging.info ('Logging initialized')

[....]

gtk.gdk.threads_enter()
gtk.main()
gtk.gdk.threads_leave()
#################

I can't a find a way to solve this as the hangs are random and they have 
no sense.

Any help would be appreciate it. Thanks!

Matías


More information about the pygtk mailing list