Page MenuHomePhabricator

Pywikibot: crashes with HiddenKeyError
Closed, ResolvedPublicBug


Steps to Reproduce:

Run this command on a wiki where there is a hidden username in the username log (e.g. ar.wikiquote).

python -edit:0 -nlog -sul -limit:5000

Expected Results:

The bot should skip users whose usernames are hidden and continue working on other users

Actual Results:

The bot crashes with HiddenKeyError (because the username of the account with User ID 23292 was hidden) and you have to restart the bot run again.

Traceback (most recent call last):
  File "", line 250, in <module>
    if not main():
  File "", line 243, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "", line 95, in run_python_file
  File "./scripts/", line 1027, in <module>
  File "./scripts/", line 1010, in main
  File "./scripts/", line 774, in run
    for users in self.parseNewUserLog():
  File "./scripts/", line 726, in parseNewUserLog
  File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/", line 177, in page
    self._page = pywikibot.User(,['title'])
  File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/", line 38, in __missing__
    'permission to view it.'.format(self._type, key))
pywikibot.exceptions.HiddenKeyError: Log entry (newusers) has a hidden 'title' key and you don't have permission to view it.
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.HiddenKeyError'>

Event Timeline

Meno25 created this task.Apr 29 2019, 6:21 PM
Xqt triaged this task as Normal priority.Apr 29 2019, 6:31 PM
JJMC89 claimed this task.Apr 30 2019, 1:44 AM

Change 507236 had a related patch set uploaded (by JJMC89; owner: JJMC89):
[pywikibot/core@master] [FIX] Skip hidden users

Xqt changed the subtype of this task from "Task" to "Bug Report".Apr 30 2019, 4:17 AM
Xqt closed this task as Resolved.Apr 30 2019, 5:59 AM
Xqt added a subscriber: Xqt.

Thanks @JJMC89 for solving and Meno25 for reporting this bug

Change 507236 merged by jenkins-bot:
[pywikibot/core@master] [FIX] Skip hidden users