
Sept. 14, 2009
3:15 a.m.
Steven D'Aprano wrote:
I think it's worth considering what the OP's real complaint is: namely, that (some? all?) C extensions can't be interrupted by ctrl-C as the user would expect. Is that a valid issue, or is it expected that Python has no control over what happens inside the C extension?
I think it's an unavoidable consequence of the desire to be able to unwind cleanly in the event of a Ctrl-C. If it happens in the middle of arbitrary C code, you can't just jump out of it because that could leave things in an unpredictable state, and execution of further Python code wouldn't be safe. -- Greg