This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author langmead
Date 2004-06-18.02:35:45
SpamBayes Score
Marked as misclassified
Logged In: YES 

Here is another possible approach to solving the problem of readline 
exiting for signals other than SIGINT. I'm not sure if it is better or worse 
than the scarypatch.

As you said, the call to readline is performed without the GIL. So is the 
actual C-level signal handler from the signal module (the python code 
that gets associated with the signal is deferred until later.) At the time 
we see the EINTR, there is a flag in the signal module's Handler array to 
say whether the signal that we received was a SIGINT. If we added some 
sort of  interface within the signal module to find out what signals are 
pending to be run on the next call to PyErr_CheckSignals, then we could 
find out if the EINTR was caused by an INT (at which point we should 
exit) or by another signal (at which we could just retry the select.)

Is there any potential to this approach? 
Date User Action Args
2007-08-23 15:37:54adminlinkissue960406 messages
2007-08-23 15:37:54admincreate