jenkins-bot has submitted this change and it was merged.
Change subject: Stop reading 'cookieprefix' upon login ......................................................................
Stop reading 'cookieprefix' upon login
We don't even use the cookies it tries to create, and cookieprefix is being removed from MediaWiki, so this entire hunk of code is useless, and has been removed.
Bug: T142155 Change-Id: I449e75870fa2cbcb50a55c2b05805a2c084e6913 --- M pywikibot/data/api.py 1 file changed, 7 insertions(+), 9 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 62ec818..66c9aec 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -3003,7 +3003,12 @@
Parameters are all ignored.
- @return: cookie data if successful, None otherwise. + Note, this doesn't actually return or do anything with cookies. + The threadedhttp module takes care of all the cookie stuff, + this just has a legacy name for now and should be renamed in the + future. + + @return: empty string if successful, throws exception on failure
""" if hasattr(self, '_waituntil'): @@ -3030,14 +3035,7 @@ if u"login" not in login_result: raise RuntimeError("API login response does not have 'login' key.") if login_result['login']['result'] == "Success": - prefix = login_result['login']['cookieprefix'] - cookies = [] - for key in ('Token', 'UserID', 'UserName'): - cookies.append("%s%s=%s" - % (prefix, key, - login_result['login']['lg' + key.lower()])) - self.username = login_result['login']['lgusername'] - return "\n".join(cookies) + return '' elif login_result['login']['result'] == "NeedToken": # Kept for backwards compatibility token = login_result['login']['token']