...

View Full Version : KeyError Plus Other Issues



ADZZZ
03-02-2009, 06:52 PM
Hello,

I do not specifically know Python, but I have a rather good grasp of programming in general, but today i am left scratching my head.

I have a script that I have grabbed that essentially logs into my asterisk server, listens to events and then pushes them into mysql database.

I am getting the following error:



[root@sipsrv03 events]# ./ProxyMan.py
[root@sipsrv03 events]# Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.4/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.4/threading.py", line 638, in __exitfunc
self._Thread__delete()
File "/usr/lib/python2.4/threading.py", line 522, in __delete
del _active[_get_ident()]
KeyError: -1208293696
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.4/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.4/threading.py", line 638, in __exitfunc
self._Thread__delete()
File "/usr/lib/python2.4/threading.py", line 522, in __delete
del _active[_get_ident()]
KeyError: -1208293696


I can provide the code if necessary.

Thank you so much for any assistance you may be able to send my way!

shedokan
05-28-2009, 06:22 PM
I learned a little python for making an app engine app, but i think I can help you.

keyerror means that that key doesn't exists in a list or an array.

if you are using lists the use hasattr(list, 'keyname').

can I ask what are you trying to do? add a new key to an array? or what?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum