jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/372499 )
Change subject: http.py: Show a more descriptive warning about invalid authentication tokens ......................................................................
http.py: Show a more descriptive warning about invalid authentication tokens
Bug: T173498 Change-Id: I1c1e69ef97d1aebfc591ad58ed28f6394bcd4557 --- M pywikibot/comms/http.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index e889975..146f8b6 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -340,9 +340,11 @@ if path in config.authenticate: if len(config.authenticate[path]) in [2, 4]: return config.authenticate[path] - else: - warn('Invalid authentication tokens for %s ' - 'set in `config.authenticate`' % path) + warn('config.authenticate["{path}"] has invalid value.\n' + 'It should contain 2 or 4 items, not {length}.\n' + 'See https://www.mediawiki.org/wiki/Manual:Pywikibot/OAuth ' + 'for more info.' + .format(path=path, length=len(config.authenticate[path]))) return None
pywikibot-commits@lists.wikimedia.org