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 72333 - pygtk should handle unix signals
pygtk should handle unix signals
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: general
1.99.x/2.0.x
Other All
: Normal enhancement
: pygtk-2.0
Assigned To: Python bindings maintainers
Python bindings maintainers
: 96018 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-02-23 10:46 UTC by James Henstridge
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Add a timeout add that calls Py_CheckSignals every 100ms in initgtk (1.82 KB, patch)
2002-11-04 19:29 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review

Description James Henstridge 2002-02-23 10:46:25 UTC
Python has a facility to add "pending" calls, which get called as a part of
the main interpreter loop.

These functions are added with Py_AddPendingCall().  If no python code is
being executed, then Py_MakePendingCalls() must be called in order to flush
the pending calls.  This function returns negative on an exception.

Currently, the signal handling code is the only thing I know of that uses
this code, but there may be others.

The gobject or gtk modules should set up a main loop source that calls
python pending calls.  This would make the signal module work correctly in
pygtk programs.
Comment 1 James Henstridge 2002-08-21 06:18:48 UTC
Looks like PyErr_CheckSignals() is the right one to call.
Comment 2 James Henstridge 2002-08-21 06:30:25 UTC
Tkinter calls PyErr_CheckSignals() once per mainloop iteration (in
Tkapp_MainLoop).  It also sleeps 20ms between iterations of the mainloop.

I suppose the equivalent would be a 20ms timeout function that called
PyErr_CheckSignals() then.
Comment 3 Johan (not receiving bugmail) Dahlin 2002-11-04 19:26:36 UTC
*** Bug 96018 has been marked as a duplicate of this bug. ***
Comment 4 Johan (not receiving bugmail) Dahlin 2002-11-04 19:29:05 UTC
Created attachment 12035 [details] [review]
Add a timeout add that calls Py_CheckSignals every 100ms in initgtk
Comment 5 James Henstridge 2002-11-20 13:42:17 UTC
mass reassign of open pygtk and gnome-python bugs.
Comment 6 Johan (not receiving bugmail) Dahlin 2003-01-24 01:52:26 UTC
Decided it was a good time fixing this bug now.

Committed last patch to CVS