<class 'sqlalchemy.exc.ProgrammingError'>
Python 2.5.2: /usr/local/bin/python
Wed Jan 7 19:44:28 2009

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py in run(self=<flup.server.fcgi_base.Request object at 0x91d11ac>)
  556         """Runs the handler, flushes the streams, and ends the request."""
  557         try:
  558             protocolStatus, appStatus = self.server.handler(self)
  559         except:
  560             traceback.print_exc(file=self.stderr)
protocolStatus undefined, appStatus undefined, self = <flup.server.fcgi_base.Request object at 0x91d11ac>, self.server = <flup.server.fcgi.WSGIServer object at 0x829756c>, self.server.handler = <bound method WSGIServer.handler of <flup.server.fcgi.WSGIServer object at 0x829756c>>
 /usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py in handler(self=<flup.server.fcgi.WSGIServer object at 0x829756c>, req=<flup.server.fcgi_base.Request object at 0x91d11ac>)
 1114         try:
 1115             try:
 1116                 result = self.application(environ, start_response)
 1117                 try:
 1118                     for data in result:
result = None, self = <flup.server.fcgi.WSGIServer object at 0x829756c>, self.application = <__main__.LighttpdFix object at 0x829744c>, environ = {'DOCUMENT_ROOT': '/usr/local/www/rangaku.org', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'Accept: application/xhtml+xml,text/html;q=0.9,text/plain;', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CACHE_CONTROL': 'no-cache', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'www.rangaku.org', 'HTTP_PRAGMA': 'no-cache', ...}, start_response = <function start_response at 0x90ad25c>
 /usr/local/www/rangaku.org/fcgi_frontend.py in __call__(self=<__main__.LighttpdFix object at 0x829744c>, environ={'DOCUMENT_ROOT': '/usr/local/www/rangaku.org', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'Accept: application/xhtml+xml,text/html;q=0.9,text/plain;', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CACHE_CONTROL': 'no-cache', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'www.rangaku.org', 'HTTP_PRAGMA': 'no-cache', ...}, start_response=<function start_response at 0x90ad25c>)
   19                                environ.get('PATH_INFO', '')
   20         environ['SCRIPT_NAME'] = ''
   21         return self.app(environ, start_response)
   22 
   23 if __name__ == '__main__':
self = <__main__.LighttpdFix object at 0x829744c>, self.app = <function app at 0x866079c>, environ = {'DOCUMENT_ROOT': '/usr/local/www/rangaku.org', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'Accept: application/xhtml+xml,text/html;q=0.9,text/plain;', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CACHE_CONTROL': 'no-cache', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'www.rangaku.org', 'HTTP_PRAGMA': 'no-cache', ...}, start_response = <function start_response at 0x90ad25c>
 /usr/local/www/rangaku.org/kouyou/application.py in app(environ={'DOCUMENT_ROOT': '/usr/local/www/rangaku.org', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'Accept: application/xhtml+xml,text/html;q=0.9,text/plain;', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5', 'HTTP_CACHE_CONTROL': 'no-cache', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'www.rangaku.org', 'HTTP_PRAGMA': 'no-cache', ...}, start_reponse=<function start_response at 0x90ad25c>)
   63         endpoint, values = url_adapter.match()
   64         view = import_string('kouyou.' + endpoint)
   65         resp = view(req, **values)
   66     except (HTTPException, RequestRedirect), e:
   67         resp = e
resp undefined, view = <function view at 0x89cf64c>, req = <kouyou.application.Request object at 0x923326c>, values = {'headword': u'\u967d\u30a4\u30aa\u30f3'}
 /usr/local/www/rangaku.org/kouyou/dictionary.py in view(request=<kouyou.application.Request object at 0x923326c>, headword=u'\u967d\u30a4\u30aa\u30f3')
  109     c = schema.engine.connect()
  110     query = select([schema.entries], schema.entries.c.headword == headword)
  111     result = c.execute(query)
  112     details = result.fetchone()
  113     return TemplatedResponse(template='entry_view.html', data={
result undefined, c = <sqlalchemy.engine.base.Connection object at 0x9233aac>, c.execute = <bound method Connection.execute of <sqlalchemy.engine.base.Connection object at 0x9233aac>>, query = <sqlalchemy.sql.expression.Select at 0x923334c; Select object>
 /usr/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py in execute(self=<sqlalchemy.engine.base.Connection object at 0x9233aac>, object=<sqlalchemy.sql.expression.Select at 0x923334c; Select object>, *multiparams=(), **params={})
  804         for c in type(object).__mro__:
  805             if c in Connection.executors:
  806                 return Connection.executors[c](self, object, multiparams, params)
  807         else:
  808             raise exc.InvalidRequestError("Unexecutable object type: " + str(type(object)))
global Connection = <class 'sqlalchemy.engine.base.Connection'>, Connection.executors = {<type 'basestring'>: <function _execute_text at 0x8827bc4>, <class 'sqlalchemy.sql.expression.ClauseElement'>: <function execute_clauseelement at 0x8827b54>, <class 'sqlalchemy.sql.expression._Function'>: <function _execute_function at 0x8827ae4>, <class 'sqlalchemy.schema.SchemaItem'>: <function _execute_default at 0x8827b1c>, <class 'sqlalchemy.schema.DDL'>: <function _execute_ddl at 0x8827c34>, <class 'sqlalchemy.engine.base.Compiled'>: <function _execute_compiled at 0x8827b8c>}, c = <class 'sqlalchemy.sql.expression.ClauseElement'>, self = <sqlalchemy.engine.base.Connection object at 0x9233aac>, object = <sqlalchemy.sql.expression.Select at 0x923334c; Select object>, multiparams = (), params = {}
 /usr/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py in execute_clauseelement(self=<sqlalchemy.engine.base.Connection object at 0x9233aac>, elem=<sqlalchemy.sql.expression.Select at 0x923334c; Select object>, multiparams=(), params=[{}])
  854                         parameters=params
  855                     )
  856         return self.__execute_context(context)
  857 
  858     def _execute_compiled(self, compiled, multiparams=None, params=None):
self = <sqlalchemy.engine.base.Connection object at 0x9233aac>, self.__execute_context undefined, context = <sqlalchemy.databases.sqlite.SQLiteExecutionContext object at 0x9233eec>
 /usr/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py in __execute_context(self=<sqlalchemy.engine.base.Connection object at 0x9233aac>, context=<sqlalchemy.databases.sqlite.SQLiteExecutionContext object at 0x9233eec>)
  876             self._cursor_executemany(context.cursor, context.statement, context.parameters, context=context)
  877         else:
  878             self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
  879         if context.compiled:
  880             context.post_exec()
self = <sqlalchemy.engine.base.Connection object at 0x9233aac>, self._cursor_execute = <bound method Connection._cursor_execute of <sqlalchemy.engine.base.Connection object at 0x9233aac>>, context = <sqlalchemy.databases.sqlite.SQLiteExecutionContext object at 0x9233eec>, context.cursor = <sqlalchemy.pool._CursorFairy object at 0x92336ec>, context.statement = u'SELECT entries.id, entries.headword, entries.rea...ning_nl \nFROM entries \nWHERE entries.headword = ?', context.parameters = [[u'\u967d\u30a4\u30aa\u30f3']]
 /usr/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py in _cursor_execute(self=<sqlalchemy.engine.base.Connection object at 0x9233aac>, cursor=<sqlalchemy.pool._CursorFairy object at 0x92336ec>, statement=u'SELECT entries.id, entries.headword, entries.rea...ning_nl \nFROM entries \nWHERE entries.headword = ?', parameters=[u'\u967d\u30a4\u30aa\u30f3'], context=<sqlalchemy.databases.sqlite.SQLiteExecutionContext object at 0x9233eec>)
  925             self.dialect.do_execute(cursor, statement, parameters, context=context)
  926         except Exception, e:
  927             self._handle_dbapi_exception(e, statement, parameters, cursor)
  928             raise
  929 
self = <sqlalchemy.engine.base.Connection object at 0x9233aac>, self._handle_dbapi_exception = <bound method Connection._handle_dbapi_exception...hemy.engine.base.Connection object at 0x9233aac>>, e = ProgrammingError('library routine called out of sequence',), statement = u'SELECT entries.id, entries.headword, entries.rea...ning_nl \nFROM entries \nWHERE entries.headword = ?', parameters = [u'\u967d\u30a4\u30aa\u30f3'], cursor = <sqlalchemy.pool._CursorFairy object at 0x92336ec>
 /usr/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/engine/base.py in _handle_dbapi_exception(self=<sqlalchemy.engine.base.Connection object at 0x9233aac>, e=ProgrammingError('library routine called out of sequence',), statement=u'SELECT entries.id, entries.headword, entries.rea...ning_nl \nFROM entries \nWHERE entries.headword = ?', parameters=[u'\u967d\u30a4\u30aa\u30f3'], cursor=<sqlalchemy.pool._CursorFairy object at 0x92336ec>)
  907                 if self.__close_with_result:
  908                     self.close()
  909             raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
  910         finally:
  911             del self._reentrant_error
global exc = <module 'sqlalchemy.exc' from '/usr/local/lib/py...QLAlchemy-0.5.0rc4-py2.5.egg/sqlalchemy/exc.pyc'>, exc.DBAPIError = <class 'sqlalchemy.exc.DBAPIError'>, exc.DBAPIError.instance = <bound method type.instance of <class 'sqlalchemy.exc.DBAPIError'>>, statement = u'SELECT entries.id, entries.headword, entries.rea...ning_nl \nFROM entries \nWHERE entries.headword = ?', parameters = [u'\u967d\u30a4\u30aa\u30f3'], e = ProgrammingError('library routine called out of sequence',), connection_invalidated undefined, is_disconnect = False

<class 'sqlalchemy.exc.ProgrammingError'>: (ProgrammingError) library routine called out of sequence u'SELECT entries.id, entries.headword, entries.reading, entries.meaning_nl \nFROM entries \nWHERE entries.headword = ?' [u'\u967d\u30a4\u30aa\u30f3']
      args = ('(ProgrammingError) library routine called out of sequence',)
      connection_invalidated = False
      instance = <bound method type.instance of <class 'sqlalchemy.exc.ProgrammingError'>>
      message = '(ProgrammingError) library routine called out of sequence'
      orig = ProgrammingError('library routine called out of sequence',)
      params = [u'\u967d\u30a4\u30aa\u30f3']
      statement = u'SELECT entries.id, entries.headword, entries.rea...ning_nl \nFROM entries \nWHERE entries.headword = ?'