[IPython-dev] Ctrl-C regression with current git master and -q4thread

Brian Granger ellisonbg at gmail.com
Thu May 20 11:45:55 EDT 2010


On Thu, May 20, 2010 at 12:26 AM, Hans Meine <hans_meine at gmx.net> wrote:
> Hi Brian!
>
> On Wednesday 19 May 2010 20:19:56 Brian Granger wrote:
>> Simple answer:  we have removed this feature
>
> OK, but that's inacceptable if not temporary, isn't it?

I agree it is undesirable, but I don't know if this is a solvable
problem, so it may not be temporary.

>> Thus, when you stop typing (right before you type ctrl-C), the event
>> loop starts.  When you type ctrl-C then KeyboardInterrupt is raised in
>> the middle of the event loop code.  This code has two options:
>>
>> 1.  Handle the KeyboardInterrupt by catching and using pass.  This is
>> what we do.
>> 2.  Let the KeyboardInterrupt propagate.  The problem with this is
>> that the code in raw_input that calls the hook that runs the event
>> loop doesn't have logic for handling KeyboardInterrupt and things
>> crash.
>
> Looks like 2. needs to be fixed then, no?  I just had a look, but it seems
> that the custom inputhook for Qt is buried inside PyQt itself?

Yes, the custom inputhook for Qt is in PyQt, but we could implement
our own version in pure Python using ctypes (like we did for wx).

I completely agree that we should look at this further.  Currently the
behavior between Tk, Wx and Qt is different (Tk actually works!),
which is also not good.  But, it might be the case that the problems
are in PyQt or Python itself.  We really want more people to start
using this stuff so we can find these bugs.  I don't have time to look
at this right now, but have created a ticket for this targeted at
0.11:

http://github.com/ipython/ipython/issues/issue/122

>> The only reason this sort of worked before in IPython is that we ran
>> the event loop in a second thread and attempted to propagate the
>> ctrl-C signal across threads (it didn't really work, which is why it
>> was unstable).
>
> Let's not talk about the old code; we're all happy that this hack is no longer
> used.. ;-)  (Yes, it was unreliable and yes, people who used it a log - like
> me - did suffer from that every now and then.)

I only mention this because some folks (not you) still talk about
bringing the old stuff back.  I don't see that as an option.

Cheers,

Brian

> Have a nice day,
>  Hans
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the IPython-dev mailing list