On Sat, 7 Apr 2007 15:41:28 -0600, "Fernando Perez"
<fperez.net@gmail.com> wrote :
> > 4) The Ctrl-C works with basic examples on IPython from standard
> > shell but it somehow breaks on IPython from Xemacs.
> > The exception is raised, but I couldn't get the prompt back (see log
> > output at the end of this email).
> > I can type or hit enter but it doesn't seem to do anything...
>> All I can say is that it works fine for me under Emacs/Linux (I do
> have to type C-c C-c, since Emacs traps the first C-c):
> [snip]
> Further testing is obviously appreciated, just make sure you are
> running with current SVN.
I've done some more testing today and here are the results with this
problem :
a) it only appears with "-pylab" and only with the WxAgg backend.
Especially vanilla IPython and IPython + pylab with TkAgg work fine
(although -pylab with Tk is useless, see one of my previous post : it
makes emacs hangs)
b) the problem seems to be that the KeyboardInterrupt is somehow
breaking some IO because I don't get a KeyboardInterrupt exception but
an IOError exception.
I've patched iplib.py to make it more obvious (see attachment for
patch) and so find a way to make it works (but I don't have a clue of
what I've done exactly).
With the patch on a standard IPython shell I got :
***************************************************************************
C:\Python25\Scripts>"C:\Python25\python.exe" -i
"C:\Python25\Scripts\ipython"
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 0.7.4.rc1 -- An enhanced Interactive Python.
? -> Introduction to IPython's features.
%magic -> Information about IPython's 'magic' % functions.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: import time
...is going on
In [2]: time.sleep(5)
So far it...
---------------------------------------------------------------------------
<type 'exceptions.KeyboardInterrupt'> Traceback (most recent call
last)
C:\Python25\Scripts\<ipython console> in <module>()
<type 'exceptions.KeyboardInterrupt'>:
...is going on
In [3]:
***************************************************************************
With the patch on IPython on Xemacs with pylab and WxAgg (comment
added with ### markup):
***************************************************************************
C:\Python25\Lib\site-packages\IPython>"C:\Python25\python.exe" -i
"C:\Python25\Scripts\ipython" -pylab -colors LightBG
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)]
Type "copyright", "credits" or "license" for more information.
IPython 0.7.4.rc1 -- An enhanced Interactive Python.
? -> Introduction to IPython's features.
%magic -> Information about IPython's 'magic' % functions.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
Welcome to pylab, a matplotlib-based Python environment.
For more information, type 'help(pylab)'.
In [1]: import time
...is going on
In [2]: time.sleep(5)
What the Hell...
...is going on
In [3]:
---------------------------------------------------------------------------
<type 'exceptions.KeyboardInterrupt'> Traceback (most recent call
last)
C:\Python25\Lib\site-packages\IPython\Shell.py in OnTimer(self, event)
842 self.timer.Start(self.interval)
843
--> 844 def OnTimer(self, event):
845 update_tk(self.tk)
846 self.IP.runcode()
<type 'exceptions.KeyboardInterrupt'>:
### Here I have to type <enter> to get back the prompt
...is going on
In [3]:
***************************************************************************
So with this patch, I can get back the prompt and have a working
IPython. So maybe we can do something about it...
Previous version of IPython (0.7.3) doesn't have any problem with
standard KeyboardInterrupt so it must be the trick you have used on
Shell.py which is breaking something...
Let me know if you want me to try anything else...
Regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iplib.py.patch
Type: text/x-patch
Size: 669 bytes
Desc: not available
Url : http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070410/1e7b96e0/attachment.bin