[Twisted-Python] Newbie reactor.crash()/reactor.stop() question

James Monteath jmonteath at dkp.com
Mon May 2 11:34:43 MDT 2005


Hi,

I have the exact same problem.  I am using the standard unittest, not 
the one found in Twisted, for the moment anyway.

All my tests work perfectly while using Twisted 1.3, calling 
reactor.crash() vs reactor.stop().  I originally had problems calling 
reactor. stop() with the python unittest framework, until I switched 
over to reactor.crash(). 

I then wanted to run the tests using Twisted 2.0.  The python process 
that starts the unittest will hang after all tests are done.   I can't 
kill the process using a CTRL-C at the command line and must use the 
kill -9 command.

Also, I noticed that the main part of the program does execute the last 
print statement found at:

if __name__ == "__main__":
    run()
    print( "This will print and then hang" )


The following is a bug that had similar behavior, which **may** explain 
the source of the issue:

http://twistedmatrix.com/bugs/issue994

I am using python 2.3.4 on SUSE 9.2,  and also new to Twisted...

James.



glyph at divmod.com wrote:

>
>
> On Sat, 30 Apr 2005 11:16:19 -0400, T Barket <thomas_barket at yahoo.com> 
> wrote:
>
>> Hello,
>
>
>> i have read i cannot stop and restart a reactor (which is what i 
>> would like
>> to do on the client side).
>
>
> It sounds like you may have found a bug (I'll look into it) but...
>
> If you want to use the reactor interactively, look into the various 
> incarnations of Manhole.  Stopping the reactor and starting it again 
> has lots of ugly side-effects which are hard to explain until you've 
> had a lot of experience working with the reactor the "right" way.
>
> (If you absolutely need it, of course, it should work, and we'll fix 
> it - but it's extremely rare that people actually need it, and pretty 
> common that people *think* they need it.)
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20050502/b183adec/attachment.html>


More information about the Twisted-Python mailing list