[IPython-user] KeyboardInterrupt (Ctrl-C) weirdness

Eli Golovinsky egooli@gmail....
Wed Mar 18 03:02:56 CDT 2009

Thanks. Running "python C:\Python25\Scripts\ipython-script.py" seems to
solve the issue.

gooli @ www.testuff.com

On Wed, Mar 18, 2009 at 12:31 AM, Jörgen Stenarson <
jorgen.stenarson@bostream.nu> wrote:

> gooli skrev:
>> I'm running Python 2.5.4 and IPython 0.9.1 with PyReadline 1.5 on Windows
>> XP
>> SP3 and I'm seeing some weird behavior with regards to hitting Ctrl-C
>> while
>> running in an infinite loop.
>> I type the following code in:
>> while True:
>>    i = 0
>> and once it starts to run I hit Ctrl-C to stop it, which does stop the
>> loop
>> but creates an anomaly. If I type a command and hit Enter, I get an error
>> message from Windows cmd.exe ('sdf' is not recognized as an internal or
>> external command) and get the standard C:\> command prompt. However, when
>> I
>> hit Enter again, I get the IPython green prompt back. Another Enter, back
>> to
>> command prompt, another one, back to IPython.
>> Although I seem to be jumping between cmd and IPython all the commands
>> that
>> I type seem to go to cmd with their first character removed. Accidentally
>> I
>> discovered that when I type exit in the IPython prompt and then hit Enter
>> twice, things seem to get back to normal.
>> Since this might not easily reproduce on another system and my explanation
>> above might be a bit vague, I've recorded a screen cast of what's
>> happening.
>> http://www.gooli.org/downloads/ipython-ctrl-c.avi
>>  I have seen this behaviour when running ipython after using easy_install
> to install ipython. I believe the reason is that ipython.exe in
> python2x/scripts/ launches a second python interpreter and the ctrl-c
> interrupt is caught by the one running ipython but is somehow propagted to
> the second one which is terminated. I do not know how to fix this problem.
> copied from an old message on ipython-dev:
> I usually add .py and .pyw to PATHEXT and %PYTHON_INSTALL_DIR%/scripts
> to PATH to ensure I can just type ipython at the commandprompt. With
> these environment variables set, I can run ipython just fine at the
> cmd-prompt after running a windows installer from latest trunk.
> It looks like the ipython shell script in %PYTHON%/Scripts is copied to
> ipython.py on line 76 in ipython_win_post_install.py perhaps the other
> scripts should be given the same treatment.
> /Jörgen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20090318/f9b26d76/attachment.html 

More information about the IPython-user mailing list