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

Brian Granger ellisonbg at gmail.com
Wed May 19 14:19:56 EDT 2010


Simple answer:  we have removed this feature

Less simple answer:  this feature was reclassified as a bug a fixed :)

Complex answer:

The new approach to GUI integration works like this.  Anytime you stop
typing, raw_input calls a hook that runs the events loop.  When you
start typing again, the hook stops running the event loop.

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.

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).

Cheers,

Brian

On Wed, May 19, 2010 at 5:54 AM, Hans Meine <hans_meine at gmx.net> wrote:
> Hi,
>
> I am just trying out the current ipython from github, and I noticed that I
> cannot clear the commandline using Ctrl-C anymore when using -q4thread.
> Even worse, the next command that I confirm using [enter] is getting a delayed
> KeyboardInterrupt.
>
> Have a nice day,
>  Hans
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
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