Comment 3 for bug 366334

Revision history for this message
Jörgen Stenarson (jorgen-stenarson) wrote : Re: [Bug 366334] Re: test_magic.test_obj_del fails on win32

Brian Granger skrev:
> Here is an IPython session showing this bug:
>
> In [4]: from IPython.platutils import find_cmd
>
> In [5]: from IPython.platutils import get_long_path_name
>
> In [6]: cmd = find_cmd('ipython')
>
> In [7]: cmd
> Out[7]: 'C:\\Python25\\Scripts\\ipython.exe'
This exe file is some easy_install magic which has caused me some
problems before. Why not try to do a call to python ipython.py instead?

>
> In [8]: _ip.IP.getout
> _ip.IP.getoutput _ip.IP.getoutputerror
>
> In [8]: _ip.IP.getoutput(cmd+' obj_del.py')
> Out[8]: ''
>
> In [9]: _ip.IP.getoutput('ipython obj_del.py')
> Out[9]: ''
>
> I spent some time looking around and getoutput uses genutils.getoutput,
> which uses os.popen. The odd thing is when I use os.popen3, to get the
> stderr, it hangs and when I use CTRL-C to abort, IPython crashes hard.
> :-(
This crash may be related to the problem I have seen with ipython.exe
before. There have been some threads on the lists about this problem
before. Basically the ipython.exe launches a new process that starts a
python process that runs ipython. But the original process still sees
any ctrl-c action you do and shuts down. My recomendation is to not use
ipython.exe at all.

/Jörgen