Not sure if I've done something wrong with my list code or if I'm running into an issue with the new view server. The views I'd written worked as expected so I take it that the new view server files were installed OK, but now trying to write a test list against one of those views seems to encounter an issue compiling the list code. This looks like the relevant portion of the view server log. Any thoughts?
c = 0
for row in get_row():
send(str(c) + row['key'][0])
c+=1
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/compiler.py", line 284, in compile_func
bytecode = compile(funstr, '<string>', 'exec')
File "<string>", line 1
def fun(head, req):
^
SyntaxError: invalid syntax
[2011-06-30 15:17:18,363] [couchdb.server] [ERROR] Error `compilation_error` occurred: invalid syntax (<string>, line 1)
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/__init__.py", line 253, in run
retval = self.commands[cmd](*args)
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/ddoc.py", line 83, in ddoc
func = compile_func(func, ddoc)
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/compiler.py", line 288, in compile_func
raise Error('compilation_error', err)
Error: ('compilation_error', SyntaxError('invalid syntax', ('<string>', 1, 20, 'def fun(head, req):\r\n')))
[2011-06-30 15:17:18,363] [couchdb.server.stream] [DEBUG] Data to respond:
['error', 'compilation_error', SyntaxError('invalid syntax', ('<string>', 1, 20, 'def fun(head, req):\r\n'))]
[2011-06-30 15:17:18,363] [couchdb.server] [ERROR] TypeError: SyntaxError('invalid syntax', ('<string>', 1, 20, 'def fun(head, req):\r\n')) is not JSON serializable
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/__init__.py", line 255, in run
retval = self.error_handler(*sys.exc_info())
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/__init__.py", line 233, in error_handler
return self.error_handlers.get(type, default)(type, value, traceback)
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/__init__.py", line 176, in handle_qs_error
stream.respond(retval)
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/server/stream.py", line 43, in respond
obj = json.encode(obj)
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/json.py", line 65, in encode
return _encode(obj)
File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/json.py", line 113, in <lambda>
dumps(obj, allow_nan=False, ensure_ascii=False)
File "/usr/lib/pymodules/python2.6/simplejson/__init__.py", line 237, in dumps
**kw).encode(obj)
File "/usr/lib/pymodules/python2.6/simplejson/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/pymodules/python2.6/simplejson/encoder.py", line 260, in iterencode
return _iterencode(o, 0)
File "/usr/lib/pymodules/python2.6/simplejson/encoder.py", line 177, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: SyntaxError('invalid syntax', ('<string>', 1, 20, 'def fun(head, req):\r\n')) is not JSON serializable
[2011-06-30 15:17:18,380] [couchdb.server.stream] [DEBUG] Data to respond:
['error', 'TypeError', "SyntaxError('invalid syntax', ('<string>', 1, 20, 'def fun(head, req):\\r\\n')) is not JSON serializable"]