Re: sys.stderr and thread
- From: Michele Petrazzo <michele.petrazzo@xxxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 19:10:02 +0200
Peter Hansen wrote:
Michele Petrazzo wrote:This is the exception:
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
One of the steps the interpreter takes is to go through all modules and rebind all globals to None. I suspect currentThread is a global in the above (although I thought that particular issue was fixed in Python 2.4... are you running an older version?).
Like you can see (c:\python23), I'm working with python 2.3. I'll try with 2.4.
The "simplest" thing to do is to ignore this exception because it's spurious". One way to ignore it is simply to wrap that particular daemon thread's "run" method with a "try/except: pass" so that all exceptions are swallowed quietly. Often that's not preferable, however, since it will of course swallow real exceptions too.
After a lot of tries, I modify the twisted threadselectreactor with your hack, and now it work.
-Peter
Thanks a lot, Michele .
- References:
- sys.stderr and thread
- From: Michele Petrazzo
- Re: sys.stderr and thread
- From: Peter Hansen
- sys.stderr and thread
- Prev by Date: Re: COM+, Javascript and Python
- Next by Date: anygui,anydb, any opinions?
- Previous by thread: Re: sys.stderr and thread
- Next by thread: exit after process exit
- Index(es):