jenkins-bot submitted this change.
IMPR: Add additional informations to Site.login error message
Wasn't able to reproduce that issue but suggest to delete the cookie
file in such case. Adding the proposal to the error message.
Bug: T395670
Change-Id: I5534f4ef64696debba1856a382a27f10519ea75c
---
M pywikibot/site/_apisite.py
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 9480955..4dbc723 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -432,10 +432,15 @@
self._loginstatus = login.LoginStatus.AS_USER
return
- pywikibot.error(
+ pywikibot.error(fill(
f"{self.userinfo['name']} != {self.username()} after "
f'{type(self).__name__}.login() and successful '
- f'{type(login_manager).__name__}.login()')
+ f'{type(login_manager).__name__}.login(). You should'
+ ' probably delete the cookie file "pywikibot-'
+ f'{self.username()}.lwp" and re-login. You may use the'
+ ' login script.',
+ 77
+ ))
self._loginstatus = login.LoginStatus.NOT_LOGGED_IN # failure
To view, visit change 1155371. To unsubscribe, or for help writing mail filters, visit settings.