ipython -twisted weird behavior

Bug #235911 reported by Yi Qiang
2
Affects Status Importance Assigned to Milestone
IPython
Won't Fix
Medium
Brian Granger

Bug Description

I was really excited to see that one could start a twisted reactor in ipython by just giving it the -twisted flag.
However, I am not even able to get the most basic functionality to work right.

iapetus:~ > ipython -twisted
Python 2.5.2 (r252:60911, Apr 21 2008, 11:29:18)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.3 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: 2+2
Warning: Timeout for mainloop thread exceeded
switching to nonthreaded mode (until mainloop wakes up again)

In [2]:

Then when I try to exit, it just hangs indefinitely until I hit ctrl+c:

In [2]: exit()
Do you really want to exit ([y]/n)? y
^CClosing threads... Done.
Closing threads...Traceback (most recent call last):
  File "/opt/local/lib/python2.5/site-packages/ipython-0.8.3-py2.5.egg/IPython/twshell.py", line 251, in mainloop
    self.reactor.run()
  File "/opt/local/lib/python2.5/site-packages/ipython-0.8.3-py2.5.egg/IPython/twshell.py", line 229, in reactorrun
    reactorrun_orig()
  File "/opt/local/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-i386.egg/twisted/internet/base.py", line 1048, in run
    self.mainLoop()
  File "/opt/local/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-i386.egg/twisted/internet/base.py", line 1057, in mainLoop
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/opt/local/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-i386.egg/twisted/internet/base.py", line 705, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/opt/local/lib/python2.5/site-packages/ipython-0.8.3-py2.5.egg/IPython/twshell.py", line 145, in runcode
    tokill()
  File "/opt/local/lib/python2.5/site-packages/Twisted-8.1.0-py2.5-macosx-10.3-i386.egg/twisted/internet/base.py", line 495, in stop
    "Can't stop reactor that isn't running.")
twisted.internet.error.ReactorNotRunning: Can't stop reactor that isn't running.
mainLoopThreadDeath: None
mainloop ending....

I am on OS X 10.5.3 with python 2.5.2, twisted 8.1.0 and ipython-0.8.3.

Changed in ipython:
assignee: nobody → ellisonbg
Changed in ipython:
assignee: ellisonbg → villemvainio
importance: Undecided → Medium
Revision history for this message
Ville M. Vainio (villemvainio) wrote :

This works on windows, at least. I will test with Ubuntu shortly.

Revision history for this message
Yi Qiang (yqiang) wrote : Re: [Bug 235911] Re: ipython -twisted weird behavior

On Thu, May 29, 2008 at 10:23 PM, Ville M. Vainio <email address hidden> wrote:
> This works on windows, at least. I will test with Ubuntu shortly.
>
> --
> ipython -twisted weird behavior
> https://bugs.launchpad.net/bugs/235911
> You received this bug notification because you are a direct subscriber
> of the bug.
>
Any luck on Ubuntu? I tried it on Archlinux 32bit and got pretty much
the same result. Also I thought that this was the work of Brian
Granger but he claims to have nothing to do with it :)

Cheers,
Yi

http://yiqiang.org

Revision history for this message
Fernando Perez (fdo.perez) wrote :

We just put 0.8.4 out with the -twisted flag fully disabled, until we can sort this out, because it's fully broken on anything but win32, and that doesn't inspire much confidence in the code actually being correct (twisted is fairly cross platform).

If you want to test it, all the -twisted option did was:

python -c"from IPython import twshell;twshell.IPShellTwisted().mainloop()"

So let us know if you have any insights on this one.

Revision history for this message
Yi Qiang (yqiang) wrote :

Ah, bummer. I was really excited about this feature!

On Sat, May 31, 2008 at 5:20 PM, Fernando Perez <email address hidden> wrote:
> We just put 0.8.4 out with the -twisted flag fully disabled, until we
> can sort this out, because it's fully broken on anything but win32, and
> that doesn't inspire much confidence in the code actually being correct
> (twisted is fairly cross platform).
>
> If you want to test it, all the -twisted option did was:
>
> python -c"from IPython import
> twshell;twshell.IPShellTwisted().mainloop()"
>
> So let us know if you have any insights on this one.
>
> --
> ipython -twisted weird behavior
> https://bugs.launchpad.net/bugs/235911
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Brian Granger (ellisonbg) wrote :

This option has been removed as it was not working properly

Changed in ipython:
assignee: villemvainio → ellisonbg
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.