Closed kracekumar closed 9 years ago
Seems there needs some amount of rewrite.
In [9]: m.get(params={'action': 'query', 'titles': 'time'})
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/hasgeek/codes/js/B2G/<ipython-input-9-7313cb8cb838> in <module>()
----> 1 m.get(params={'action': 'query', 'titles': 'time'})
/home/hasgeek/codes/python/python-mwapi/mwapi/__init__.py in get(self, params)
111 params - Parameters to send to the API. Varies depending on the action to be performed.
112 """
--> 113 return self.request('GET', params)
114
115 def post(self, params):
/home/hasgeek/codes/python/python-mwapi/mwapi/__init__.py in request(self, method, params, data)
52 params=params,
53 data=data,
---> 54 prefetch=True)
55 return json.loads(resp.content)
56
TypeError: request() got an unexpected keyword argument 'prefetch'
prefetch
needs to be stream
from v1.0.0
, citation: http://kennethreitz.com/announcing-requests-v100.html
It looks like this was fixed by https://github.com/yuvipanda/python-mwapi/pull/2
From
requests 1.0.0
api forSession
doesn't accept any parameter. Following code will break.Link to new Api: https://github.com/kennethreitz/requests/blob/master/requests/sessions.py#L137