Stang created this task. Stang added a project: Pywikibot. Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION Currently when trying to login with botpassword, a warning message indicating "fetching a token via "action=login" is deprecated" will be shown, and an error message will be returned. The logic inside `login_to_site` function is to submit a login request (w/o "lgtoken" parameter) first <https://github.com/wikimedia/pywikibot/blob/f9d33837b7a9751da8627707705252e4ff6f6046/pywikibot/data/api.py#L2979>, then perform a re-login. I thought probably we could move the code block of getting a login token to the position before submit a login request (inside that while True loop), which could fix such warning. >>> import pywikibot >>> site = pywikibot.Site('test', 'wikipedia', user='Crystal-bot') >>> site.login() WARNING: No user is logged in on site wikipedia:zh Logging in to wikipedia:test as Crystal-bot@signbot1 WARNING: API warning (main): Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes. Use [[Special:ApiFeatureUsage]] to see usage of deprecated features by your application. WARNING: API warning (login): Fetching a token via "action=login" is deprecated. Use "action=query&meta=tokens&type=login" instead. ERROR: Received incorrect login token. Forcing re-login. >>> TASK DETAIL https://phabricator.wikimedia.org/T309898 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Stang Cc: Aklapper, pywikibot-bugs-list, Stang, Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, Masti, Alchimista
_______________________________________________ pywikibot-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
