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 Araneidae
Recipients Araneidae
Date 2008-06-23.16:32:19
SpamBayes Score 0.0439447
Marked as misclassified No
Message-id <>
The (undocumented!) API for PyOS_InputHook has two defects which are
addressed in the attached patch (at least when using the readline
module): firstly the called hook currently has to guess that input will
come on descriptor 0; secondly, any Ctrl-C interrupts encountered during
the processing of the input hook are lost.

This loss of interrupts can be rather annoying.  The attached patch
addresses these problems by redefining the API to PyOS_InputHook as 

    int PyOS_InputHook(int file_in);

where file_in is the descriptor to monitor (PyOS_InputHook need not
return until file_in is ready to read), and the return value is non-zero
if and only if processing was interrupted.

Testing for interruption is implemented in the HAVE_RL_CALLBACK and
HAVE_SELECT branch of Modules/readline.c; other uses retain their
original functionality (I believe!).

The attached patch was prepared against , current at the time of
Date User Action Args
2008-06-23 16:32:24Araneidaesetspambayes_score: 0.0439447 -> 0.0439447
recipients: + Araneidae
2008-06-23 16:32:23Araneidaesetspambayes_score: 0.0439447 -> 0.0439447
messageid: <>
2008-06-23 16:32:22Araneidaelinkissue3180 messages
2008-06-23 16:32:21Araneidaecreate