jenkins-bot has submitted this change and it was merged.
Change subject: (assertion fix) TypeError while raising APIError ......................................................................
(assertion fix) TypeError while raising APIError
APIError constructor includes two named keyword arguments and kwargs.
If json.loads returns something other than a dict, api.py tries to raise an APIError exception passes a third unnamed argument to the constructor, causing a TypeError exception to be raised.
Change-Id: Ieb7741d5737e6b0ad84b188b914f30411cdf0924 --- M pywikibot/data/api.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index a0f5aeb..d82e1a9 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -354,7 +354,7 @@ raise APIError("Unknown", "Unable to process query response of type %s." % type(result), - {'data': result}) + data=result) if self['action'] == 'query': if 'userinfo' in result.get('query', ()): if hasattr(self.site, '_userinfo'):
pywikibot-commits@lists.wikimedia.org