| KeyError | Python 2.4.4: /usr/bin/python Fri Jul 25 08:51:57 2008 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
| /var/www/www.aaronsw.com/2002/mid.cgi |
| 36 if __name__ == "__main__": |
| 37 import cgi |
| 38 q = cgi.FieldStorage()['q'].value |
| 39 r = mid2url(q) |
| 40 if not r: |
| q undefined, cgi = <module 'cgi' from '/usr/lib/python2.4/cgi.pyc'>, cgi.FieldStorage = <class cgi.FieldStorage>, ].value undefined |
| /var/www/www.aaronsw.com/2002/cgi.py in __getitem__(self=FieldStorage(None, None, []), key='q') |
| 561 if item.name == key: found.append(item) |
| 562 if not found: |
| 563 raise KeyError, key |
| 564 if len(found) == 1: |
| 565 return found[0] |
| builtin KeyError = <class exceptions.KeyError>, key = 'q' |
KeyError: 'q'
args =
('q',)