[issue6073] threading.Timer and gtk.main are not compatible

2009-05-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: When using gtk and threads, it's necessary to call gtk.gdk.threads_init() -- nosy: +amaury.forgeotdarc resolution: -> works for me status: open -> closed ___ Python tracker

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-27 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: pygtk doesn't release the GIL around its internal calls unless you call threads_init. So I think this is pretty clearly just a misuse of the pygtk library. There's nothing at all Python can do about it. If an extension library doesn't release the GIL, no

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well I'm not a gtk user, but try to do something else than a "print" in the timer. Perhaps gtk redirects all standard IO or something. It sounds very strange that threads would stop working when gtk is imported. -- _

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-24 Thread Eric
Eric added the comment: OK, this is a workaround. adding this line gtk.gdk.threads_init() makes the job. And that's ok for me. nevertheless, I still got the feeling that's this is a flaw in the Timer implementation: it's behaviour is changed by some external (gtk) code. -- status:

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: It is probably a problem with the gtk/gobject Python binding. By the way, you're supposed to call `gobject.threads_init()` if you use threads with Python and gobject/gtk. Besides, gtk certainly has its own timing facilities, while threading.Timer is rather crude

[issue6073] threading.Timer and gtk.main are not compatible

2009-05-20 Thread Eric Atienza
New submission from Eric Atienza : this simple code: " import gtk from threading import Timer from time import sleep def p(): print "p" Timer(1, p).start() #gtk.main() sleep(10) print "done" does print "p" a second after it starts. when I remove the comment of the gtk.main() line: the "p"