jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/584538 )
Change subject: [bugfix] Don't force re-login when logging in ......................................................................
[bugfix] Don't force re-login when logging in
site.login() calls site.getuserinfo(force=True), which can call site._relogin() here.
Bug: T248767 Change-Id: I66ba066bceb47f360f563f0859184a163feb4cbb --- M pywikibot/data/api.py 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 5e72deb..071932a 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1788,7 +1788,9 @@ # that we are logged in as the correct user. If this is not the # case, force a re-login. username = result['query']['userinfo']['name'] - if self.site.user() is not None and self.site.user() != username: + if (self.site.user() is not None and self.site.user() != username + and self.site._loginstatus + != pywikibot.site.LoginStatus.IN_PROGRESS): pywikibot.error( "Logged in as '{actual}' instead of '{expected}'.\n" 'Forcing re-login.'.format(actual=username,
pywikibot-commits@lists.wikimedia.org