site.login(username, password)
fails between mediawiki 1.24.1 and 1.27.0
#257
Labels
site.login(username, password)
fails between mediawiki 1.24.1 and 1.27.0
#257
With a MediaWiki 1.24.1 installation,
site.login(username, password)
fails. This happens because the raw text received back from theraw_api
call is'{"warnings":{"tokens":{"*":"Unrecognized value for parameter \'type\': login"}},"query":{"tokens":[]}}'
and then mwclient attempts to treat the content oftokens
as a dict resulting in a TypeError (list indices must be integers or slices, not str
) rather than the expected KeyError. A simple fix might be to catch TypeError here, or it might be good to explicitly check for emptyinfo['query']['tokens']
.The text was updated successfully, but these errors were encountered: