According to the Python Database API Specification v2.0, the paramters provided to the cursor.execute() method can be sequences or mappings.
http://www.python.org/peps/pep-0249.html
Right now, the CursorDebugWrapper? is converting all params to tuples before appending it to the queries list. This is causing my calls that use the pyformat paramstyle to fail during DEBUG mode. Below I removed the 'tuple()' function call which fixes my error. Of course, if there is a reason for this explicit conversion to tuple type that I do not see then a better work around would be needed.
class CursorDebugWrapper:
def __init__(self, cursor, db):
self.cursor = cursor
self.db = db
def execute(self, sql, params=[]):
start = time()
result = self.cursor.execute(sql, params)
stop = time()
self.db.queries.append({
'sql': sql % params,
'time': "%.3f" % (stop - start),
})
return result