[IPython-user] Still problems with Ctrl+C and threads in ipython 0.8 ?

Fernando Perez fperez.net@gmail....
Tue Nov 27 13:08:17 CST 2007


On Nov 27, 2007 3:58 AM, Ville M. Vainio <vivainio@gmail.com> wrote:
> On Nov 26, 2007 2:18 AM, Fernando Perez <fperez.net@gmail.com> wrote:
>
> > > KeyboardInterrupt - Press <Enter> to continue.
> > >
> > > Is this a know issue ?
> >
> > Yes, unfortunately.  Basically, we may still have a lurking race
> > condition in that code that makes it possible for the signal to end up
> > in the wrong thread.  Cross-thread signal handling in python isn't
>
> Also, I frequently get crash tracebacks on KeyboardInterrupt. It's
> probably the only defect that keeps coming up on crash logs these
> days. For example, now I got:
>
>  1487                     self.readline_startup_hook(self.pre_readline)
>    1488             else:
>    1489                 prompt = self.outputcache.prompt1
>    1490             try:
> -> 1491                 line = self.raw_input(prompt,more)
>         line = 'exit()'
>         self.raw_input = <bound method InteractiveShell.raw_input of
> <IPython.iplib.InteractiveShell object at 0x808520c>>
>         prompt = <IPython.Prompts.Prompt1 instance at 0x832f88c>
>         more = None
>    1492                 if self.autoindent:
>    1493                     self.readline_startup_hook(None)
>    1494             except KeyboardInterrupt:
>    1495                 self.write('\nKeyboardInterrupt\n')
>    1496                 self.resetbuffer()
>
> And the exception was KeyboardInterrupt. It just isn't caught properly.

Hey Ville, can you forward me one of those logs?  I'd like to have a
look, even though I doubt I'll be able to fix much.  This is likely a
nasty race condition that I'm not sure we can really fix correctly
ever (given the fundamental clash between threads and the fact that
Ctrl-C is fully asynchronous).

BTW, if there's any thread guru in our midst and you really would like
to earn yourself a large heaping of good Karma, here's a project for
the holidays: give our threading support a good review, tell me all
the stupid things I did, and help us get that stuff to be really solid
once and for all.  It's really embarrassing to have this still crash
on people so easily...

Cheers,

f


More information about the IPython-user mailing list