[annotator-dev] annotator store run.py problem - TypeError: ResultSet indices must be integers, not str

johnny jiang johnny.nan.jiang at gmail.com
Tue May 22 10:17:38 UTC 2012


Hi guys,

Just wondering if any of you have come across the following Python error
when running python run.py for annotator flask store.
TypeError: ResultSet indices must be integers, not str

Detailed stack trace as below, is it something to do with Python version?
This error happened on my CentOS 6.2 where I have Python 2.6, my windows
with Python 2.7 is all right.

TypeError
TypeError: ResultSet indices must be integers, not str

Traceback (most recent call last)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1518, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1506, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1504, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1264, in
full_dispatch_request
rv = self.handle_user_exception(e)
[console ready]
>>>
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1262, in
full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1248, in
dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File
"/home/jiangnan/dev/projects/workspace_aptana/okfn/src/server/annotator-store/annotator/store.py",
line 46, in index
annotations = Annotation.search(_user_id=user, _consumer_key=consumer)
File
"/home/jiangnan/dev/projects/workspace_aptana/okfn/src/server/annotator-store/annotator/elasticsearch.py",
line 118, in search
docs = res['hits']['hits']
File "/usr/lib/python2.6/site-packages/pyes/es.py", line 1780, in
__getitem__
self.__class__.__name__, val.__class__.__name__))
TypeError: ResultSet indices must be integers, not str
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20120522/bfb2e69e/attachment-0002.html>


More information about the annotator-dev mailing list