[Twisted-Python] wxpython, threadselectreactor and thread

Michele Petrazzo michele.petrazzo at unipex.it
Mon May 30 08:35:40 EDT 2005


I have a wxpython application that work with twsited 2.0 on win and
linux. In these days I'm "porting" it from twisted 1.3 to 2.0 +
threadselectreactor, but not all work well.
Into my application I use:
callLater
threads.deferToThread with some addCallBack

Three problems:

1) Sometime then I open and close my application I receive this error:

Unhandled exception in thread started by <bound method
Thread.__bootstrap of <Thread(Thread-1, stopped daemon)>>
Traceback (most recent call last):
   File "C:\Python23\lib\threading.py", line 451, in __bootstrap
     self.__stop()
   File "C:\Python23\lib\threading.py", line 460, in __stop
     self.__block.notifyAll()
   File "C:\Python23\lib\threading.py", line 256, in notifyAll
     self.notify(len(self.__waiters))
   File "C:\Python23\lib\threading.py", line 238, in notify
     currentThread() # for side-effect
TypeError: 'NoneType' object is not callable

2) Then I call with threads.deferToThread a method that make a blocking
work, and after it open a new frame, the frame is opened, but if I want
to close the first frame and the second frame (with the "X" on the
frame), the application don't close. Into the task manager (on win) or
into /proc/"pid" I see that the process (python.exe) are alive and have
three threads. I attach a simple code that reproduce this problem.

3) Why into your demo the reactor.stop() work and into my code I receive
this error:
RuntimeError: can't stop reactor that isn't running
I use the same code initialization of the demo.

Thanks a lot,
Michele

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wx_f.py
Type: text/x-python
Size: 1798 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20050530/7eab8511/attachment.py 


More information about the Twisted-Python mailing list