[Twisted-Python] 9.0.0 question

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Jan 22 18:15:20 EST 2010

On 10:42 pm, termim at gmail.com wrote:
>On Fri, Jan 22, 2010 at 4:40 PM,  <exarkun at twistedmatrix.com> wrote:
>>On 21 Jan, 03:30 pm, termim at gmail.com wrote:
>>>2. Why reactor.stop() hangs if it is called before reactor.run()?
>>It doesn't.  It raises an exception.  The reason the example hangs is 
>Care to elaborate? Who hangs then and why python exits and I see this
>exception only after I hit Cntl-C?

I think that's what I explained in the rest of the sentence that is cut 
off above.  You may only see the exception reported later on because the 
example is relying on garbage collection for that reporting.
>Actually I noticed this problem in my old wxPython/Twisted application.
>Before upgrade everything was sweet and shiny but when I upgraded
>Twisted to 9.0 my application suddenly started to hang on exit. BTW
>I use wxreactor and install it exactly as in 
>It is interesting that doc/core/examples/wxacceptance.py has no such a 
>but doc/core/examples/wxdemo.py has! If I start it, wait till it
>prints to stdout
>"two seconds passed" and then try to quit it either by File->Exit or by 
>on the WM close button it does not respond, even if I hit Cntrl-C in 
>terminal from where I run it, but if after Cntrl-C I go to the
>File->Exit it quits
>after printing "Received SIGINT, shutting down."

This sounds familiar.  I think wxreactor has some wake-up issues.  It's 
not a very reliable reactor.  wxPython differs in various ways on 
different platforms and from release to release in ways which wxreactor 
doesn't account for.

I think the problem with the dns example is probably not related to your 
wxreactor issues at all.


More information about the Twisted-Python mailing list