Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #2
    Regular Coder
    Join Date
    Oct 2007
    Posts
    277
    Thanks
    2
    Thanked 4 Times in 4 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •