CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Python (http://www.codingforums.com/forumdisplay.php?f=46)
-   -   KeyError Plus Other Issues (http://www.codingforums.com/showthread.php?t=160155)

ADZZZ 03-02-2009 05:52 PM

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:

Code:

[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 05: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?


All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.