Page MenuHomePhabricator

Either enable captcha for not autoconfirmed user or show an error message other than a "KeyError: 'messagecode'"
Closed, ResolvedPublic


Captcha handling is not supported currently I guess. Maybe it was previously. Either (re-)enable captcha for not autoconfirmed users or show a more informative error message. (See

Traceback (most recent call last):
  File "", line 360, in <module>
   if not main():
  File "", line 352, in main
  File "", line 73, in run_python_file
   exec(compile(source, filename, 'exec', dont_inherit=True),
  File "./scripts/", line 185, in <module>
  File "./scripts/", line 167, in main
  File "/home/yutkeej/pywikibot/pywikibot/tools/", line 1499, in wrapper
   return obj(*__args, **__kw)
  File "/home/yutkeej/pywikibot/pywikibot/site/", line 1931, in login
   if login_manager.login(retry=True, autocreate=autocreate):
  File "/home/yutkeej/pywikibot/pywikibot/", line 301, in login
   cookiedata = self.getCookie()
  File "/home/yutkeej/pywikibot/pywikibot/tools/", line 1584, in wrapper
   return obj(*new_args, **new_kwargs)
  File "/home/yutkeej/pywikibot/pywikibot/data/", line 3197, in getCookie
   and (response['messagecode'] == 'login-throttled'
KeyError: 'messagecode'
CRITICAL: Exiting due to uncaught exception <class 'KeyError'>

Event Timeline

Change 645822 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Add additional info into log if 'messagecode' is missing during login

Change 645822 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Add additional info into log if 'messagecode' is missing during login

@WolfgangFahl: Thank you for your report T297997. I don't think that your repository is 6.6.0 because there was the code change

Could you please verify.
See also

@Xqt - you are right might have been 6.0.1 - I'll watch the situation. Currently py-3rdparty-mediawiki uses semantic depencency:

# MediaWiki bot package
Xqt claimed this task.

show an error message other than a "KeyError: 'messagecode'" is already solved. I close it then. Please re-open if there is something remaining to be done.