Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_magic.test_obj_del fails on win32 #59

Closed
ipython opened this issue May 10, 2010 · 8 comments
Closed

test_magic.test_obj_del fails on win32 #59

ipython opened this issue May 10, 2010 · 8 comments
Milestone

Comments

@ipython
Copy link
Collaborator

ipython commented May 10, 2010

Original Launchpad bug 366334: https://bugs.launchpad.net/ipython/+bug/366334
Reported by: ellisonbg (Brian Granger).

test_obj_del fails on win32 because getoutput is called like this:

IP.getoutput('ipython obj_del.py')

But on Windows, the ipython executable is not found. This causes stdout to be empty
and stderr to have an error saying that ipython can't be found.

FAIL: Test that object's del methods are called on exit.

Traceback (most recent call last):
File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\case.py", line 182, in runTest
self.test(*self.arg)
File "c:\python24\external\ipython\IPython\tests\test_magic.py", line 86, in test_obj_del
nt.assert_equals(out,'obj_del.py: object A deleted')
AssertionError: '' != 'obj_del.py: object A deleted'

raise self.failureException,
(None or '%r != %r' % ('', 'obj_del.py: object A deleted'))


@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 1 by: Brian Granger, on 2009-04-24 22:56:21.616906+00:00 ]

We are now finding ipython using platutils.find_cmd, but we still see this error.

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 2 by: Brian Granger, on 2009-04-25 22:24:37.298541+00:00 ]

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'

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. :-(

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 3 by: Jörgen Stenarson, on 2009-04-26 08:10:57+00:00 ]

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

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 4 by: Brian Granger, on 2009-04-27 20:57:20+00:00 ]

Ahh, that may be it. I will give this a shot.

Brian

On Sun, Apr 26, 2009 at 1:10 AM, Jörgen Stenarson
jorgen.stenarson@bostream.nu wrote:

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

test_magic.test_obj_del fails on win32
https://bugs.launchpad.net/bugs/366334
You received this bug notification because you are a member of IPython
Developers, which is subscribed to IPython.

Status in IPython - Enhanced Interactive Python: Confirmed

Bug description:
test_obj_del fails on win32 because getoutput is called like this:

IP.getoutput('ipython obj_del.py')

But on Windows, the ipython executable is not found.  This causes stdout to be empty
and stderr to have an error saying that ipython can't be found.

FAIL: Test that object's del methods are called on exit.

Traceback (most recent call last):
 File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\case.py", line 182, in runTest
   self.test(*self.arg)
 File "c:\python24\external\ipython\IPython\tests\test_magic.py", line 86, in test_obj_del
   nt.assert_equals(out,'obj_del.py: object A deleted')
AssertionError: '' != 'obj_del.py: object A deleted'

raise self.failureException,
         (None or '%r != %r' % ('', 'obj_del.py: object A deleted'))


Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu
ellisonbg@gmail.com

@fperez
Copy link
Member

fperez commented Apr 8, 2011

@jstenar, can you see if this problem still exists?

@minrk
Copy link
Member

minrk commented May 17, 2011

This test is currently skipped on Windows, but letting it run, it does pass for me. The neighboring test_tclass that is also skipped in Windows still fails.

It does depend on win32api, so it still needs that conditional on it.

@takluyver
Copy link
Member

If this is passing on Windows now, can we remove the skip_win32 decorator and close the issue? If test_tclass still fails, should we leave this issue open for it, or start a new one?

@fperez
Copy link
Member

fperez commented May 29, 2011

@takluyver, I'd remove the deco, close this one, and open a clean one for tclass if that fails, simply with a link to this one in there in case it's useful to read some of this discussion when thinking about the tclass one.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants