[IPython-dev] ctrl-c bug using -gthread on windows, with possible solution

Pieter Cristiaan de Groot p.c.degroot at tudelft.nl
Tue Feb 3 18:45:37 EST 2009


Dear all,

running ipython 0.9.1 on windows using -gthread gives problems using 
ctrl-c. It gives an IOError when ctrl-c is pushed during the sleep(0.01) 
(File: Shell.py line 835-843), otherwise everyghing goes ok. This does 
not happen on a linux machine.

Here's the code:

    def on_timer(self):
        """Called when GTK is idle.
            Must return True always, otherwise GTK stops calling it"""
  
        update_tk(self.tk)
        self.IP.runcode()
        time.sleep(0.01)
        return True

Replacing the bottom part with this seems to solve it:

        try:
            update_tk(self.tk)
            self.IP.runcode()
            time.sleep(0.01)
            return True
        except IOError, e:
            return True



I hope this helps,

Pieter



More information about the IPython-dev mailing list