_URLFetchResult 对象没有属性“body”;通过 Python 模块调用 Freebase 时
我一直在成功地使用Freebase Python模块来读取数据,今天我开始测试将数据写入Freebase。
但我不断收到一个对我来说没有意义的错误:
在相同的代码范围内,我可以执行 mqlread(query) 而不会出现错误。
但是当我尝试时:
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 没有发回正确的结果?
I've been using the Freebase Python module successfully to read data, and today I started testing writing data to Freebase.
But I keep getting an error that isn't making sense to me:
Within the same scope of code, I can perform an mqlread(query) without error.
But when I try:
freebase.mqlwrite(query)
I get an error like:
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'
Does this mean that those calls are failing to reach Freebase? Or
that Freebase is not sending back a proper Result?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明这是 Freebase-Python 中的一个错误。我已提交该错误并提供了解决方案:http:// code.google.com/p/freebase-python/issues/detail?id=15
It turns out this is a bug in Freebase-Python. I've filed the bug and offered a solution: http://code.google.com/p/freebase-python/issues/detail?id=15