Re: error
Irmen de Jong <[email protected]>
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <[email protected]> |
On 4-7-2013 19:03, Pierre PACORY wrote: > here a simple code execute on a debian 7.0 > with Pyro4 installed via pip > > ------------------------------------------------------------------------------------ > > > #!/usr/bin/env python > # -*- coding: utf-8 -*- > > DEBUG=False > > import Pyro4 # Publication d'objet (RPC) > > if __name__ == '__main__': > daemon=Pyro4.Daemon(host="127.0.0.1",port=8888) > > ------------------------------------------------------------------------------------ > > > Sometimes i've no error when executing this code > and sometimes always have this error : > > ------------------------------------------------------------------------------------ > > Exception in thread Pyro-Worker-38065744 (most likely raised during interpreter shutdown): > Traceback (most recent call last): > File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner > File "/usr/local/lib/python2.7/dist-packages/Pyro4/tpjobqueue.py", line 48, in run > File "/usr/local/lib/python2.7/dist-packages/Pyro4/tpjobqueue.py", line 189, in getJob > <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Empty' > Exception in thread Pyro-Worker-38066128 (most likely raised during interpreter shutdown): > > ------------------------------------------------------------------------------------ > > Any idea what the problem is ! > thks for your help There's no problem really. What you're seeing there is some code in one of Pyro's worker threads that is crashing because the interpreter state is taken out underneath of it, due to interpreter shutdown, as mentioned in the error. You are aware that the tiny bit of code you posted creates a daemon and immediately exits the program? The daemon uses a pool of worker threads by default to handle requests, and it spawns a bunch of those at startup. If the interpreter is taken down while these threads are still running, sometimes Python produces the errors you are seeing. I am not aware of any real way to avoid this with worker threads, maybe someone else knows? Regargs Irmen de Jong ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev