--> -->
IndexError | Python 2.4.3: /usr/local/bin/python Fri Jul 30 04:06:07 2010 |
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
| /home/dbpatter/public_html/main.cgi |
10 environ = os.environ
|
11
|
12 import py.urlhandler
|
13
|
14 print py.urlhandler.handler(environ, start_response)
|
| py = <module 'py' from '/home/dbpatter/public_html/py/__init__.pyc'>, py.urlhandler = <module 'py.urlhandler' from '/home/dbpatter/public_html/py/urlhandler.pyc'>, py.urlhandler.handler = <function handler>, environ = {'REDIRECT_STATUS': '200', 'SERVER_SOFTWARE': 'A... 'gzip', 'UNIQUE_ID': 'TFKH70AWYBwAAFEDMUkAAAAZ'}, start_response = <function start_response> |
| /home/dbpatter/public_html/py/urlhandler.py in handler(environ={'REDIRECT_STATUS': '200', 'SERVER_SOFTWARE': 'A... 'gzip', 'UNIQUE_ID': 'TFKH70AWYBwAAFEDMUkAAAAZ'}, start_response=<function start_response>) |
8 for (url,func) in urls.urlmap:
|
9 if re.compile(url).search(environ['REQUEST_URI']):
|
10 returnval = func(environ['REQUEST_URI'])
|
11 break;
|
12 if not returnval:
|
| returnval undefined, func = <function view_oil>, environ = {'REDIRECT_STATUS': '200', 'SERVER_SOFTWARE': 'A... 'gzip', 'UNIQUE_ID': 'TFKH70AWYBwAAFEDMUkAAAAZ'} |
| /home/dbpatter/public_html/py/views.py in view_oil(request_uri='/oils/Summer_Susans/') |
107 def view_oil(request_uri):
|
108 piecename = request_uri[6:-1].replace("_"," ")
|
109 piece = db.find_oil(piecename)
|
110 if not piece: # no oil was found for name
|
111 return fourohfour(request_uri)
|
| piece undefined, global db = <module 'py.db' from '/home/dbpatter/public_html/py/db.pyc'>, db.find_oil = <function find_oil>, piecename = 'Summer Susans' |
| /home/dbpatter/public_html/py/db.py in find_oil(oilname='Summer Susans') |
14 cursor = DictCursor(db)
|
15 cursor.execute(""" SELECT * FROM oils WHERE name="%s"; """ % oilname)
|
16 oil = cursor.fetchall()[0] # returns a tuple with the dicts inside.
|
17 db.close()
|
18 if len(oil) > 0: # some result was found
|
| oil undefined, cursor = <MySQLdb.cursors.DictCursor object>, cursor.fetchall = <bound method DictCursor.fetchall of <MySQLdb.cursors.DictCursor object>> |
IndexError: tuple index out of range
args =
('tuple index out of range',)