我已经成功地使用Freebase Python模块读取数据,今天我开始测试向Freebase写入数据。
但我一直收到一个错误,这对我来说是没有意义的:
在相同的代码范围内,我可以执行mqlread(查询)而不会出错。
但当我尝试时:
freebase.mqlwrite(query)我得到一个错误,如:
File "/Users/willmerydith/repos/supermeeple-sk/admin.py", line 96, in post
result = freebase.mqlwrite(query)
File "/Users/willmerydith/repos/supermeeple-sk/freebase/api/session.py",
line 745, in mqlwrite
form=dict(query=qstr))
File "/Users/willmerydith/repos/supermeeple-sk/freebase/api/session.py",
line 442, in _httpreq_json
resp, body = self._httpreq(*args, **kws)
File "/Users/willmerydith/repos/supermeeple-sk/freebase/api/session.py",
line 428, in _httpreq
return self._http_request(url, method, body, headers)
File "/Users/willmerydith/repos/supermeeple-sk/freebase/api/httpclients.py",
line 88, in __call__
self._raise_service_error(url, resp.status_code,
resp.headers['content-type'], resp.body)
AttributeError: '_URLFetchResult' object has no attribute 'body'这是否意味着这些调用无法到达Freebase?或者Freebase没有返回正确的结果?
发布于 2011-02-08 05:39:49
事实证明这是Freebase-Python中的一个bug。我已经提交了这个bug,并提供了一个解决方案:http://code.google.com/p/freebase-python/issues/detail?id=15
https://stackoverflow.com/questions/4926422
复制相似问题