Helpful Information
 
 
Category: Python
KeyError Plus Other Issues

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:



[[email protected] events]# ./ProxyMan.py
[[email protected] 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!

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?










privacy (GDPR)