开发者

_URLFetchResult object has no attribute 'body' when calling Freebase via Python Module

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: '_URL开发者_JS百科FetchResult' 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜