Page MenuHomePhabricator crashes when processing a page that is connected to a redirected Wikidata item
Closed, ResolvedPublicBUG REPORT


Command line:

python3 commonscat -lang:ary -start:!


Script terminated by exception:

ERROR: IsRedirectPage: Page [[wikidata:Q27538657]] is a redirect page.
Traceback (most recent call last):
  File "", line 363, in <module>
    if not main():
  File "", line 358, in main
  File "", line 75, in run_python_file
  File "./scripts/", line 557, in <module>
  File "./scripts/", line 551, in main
  File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/", line 1498, in run
  File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/", line 1777, in treat
  File "./scripts/", line 312, in treat_page
    commonscatLink = self.find_commons_category(page)
  File "./scripts/", line 406, in find_commons_category
    claim = page.get_best_claim(cat_property)
  File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/page/", line 2383, in get_best_claim
  File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/page/", line 4597, in get
    raise pywikibot.IsRedirectPage(self)
pywikibot.exceptions.IsRedirectPage: Page [[wikidata:Q27538657]] is a redirect page.
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.IsRedirectPage'>

Description of problem:

  • When runs on an article that is connected to a redirected Wikidata item (ary:آيت عمار that was connected to Q27538657), it crashes.


  • Please make the script skip the page in such cases (but not crash).


  • I have manually cleared the cache of the article on arywiki (by making a null edit) and this solved the problem.

Event Timeline

Meno25 created this task.Oct 18 2020, 8:16 PM
Restricted Application added subscribers: pywikibot-bugs-list, alaa, Aklapper. · View Herald TranscriptOct 18 2020, 8:16 PM
Meno25 updated the task description. (Show Details)Oct 18 2020, 10:05 PM
Xqt triaged this task as Medium priority.Oct 19 2020, 3:41 AM
Xqt changed the subtype of this task from "Task" to "Bug Report".

Change 637717 had a related patch set uploaded (by Mpaa; owner: Mpaa):
[pywikibot/core@master] [bugfix] do not raise Exception in Page.get_best_claim()

Change 637717 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] do not raise Exception in Page.get_best_claim()

Xqt closed this task as Resolved.Oct 30 2020, 5:10 PM
Xqt claimed this task.