Page MenuHomePhabricator

pywikibot.page.isDisambig depends on disambiguationspage
Closed, ResolvedPublic

Description

When run against an empty instance using a family file generated by the family file generator

ERROR: Test various methods that rely on API.

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/build/jayvdb/pywikibot-core/tests/page_tests.py", line 403, in testApiMethods
    self.assertIsInstance(mainpage.isDisambig(), bool)
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/page.py", line 800, in isDisambig
    'disambiguationspage').split(':', 1)[1]
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/site.py", line 1955, in mediawiki_message
    return self.mediawiki_messages([key])[key]
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/site.py", line 1943, in mediawiki_messages
    % (self, key))
nose.proxy.KeyError: "Site pwbtest:en has no message 'disambiguationspage'"

https://travis-ci.org/jayvdb/pywikibot-core/jobs/64686164#L640

Event Timeline

jayvdb raised the priority of this task from to Medium.
jayvdb updated the task description. (Show Details)
jayvdb added projects: Pywikibot-tests, Pywikibot.
jayvdb added subscribers: gerritbot, Unknown Object (MLST), Ladsgroup and 2 others.

What to do with it. Seems this wiki doesn't have any disambig configurated. Should use the default template at the end. Isn't it?

Yes, it is an empty wiki, without any family configuration.
I am thinking that if there is no way to know if the page is a Disambig page, issue a FamilyMaintenanceWarning, and return False.

Change 222881 had a related patch set uploaded (by Xqt):
[bugfix] Fallback to default if mw message 'disambiguationspage' doesn't exists

https://gerrit.wikimedia.org/r/222881

Change 222881 merged by jenkins-bot:
[bugfix] Fallback to default if mw message 'disambiguationspage' doesn't exists

https://gerrit.wikimedia.org/r/222881

Change 223879 had a related patch set uploaded (by Merlijn van Deen):
[bugfix] Fallback to default if mw message 'disambiguationspage' doesn't exists

https://gerrit.wikimedia.org/r/223879

Change 223879 merged by jenkins-bot:
[bugfix] Fallback to default if mw message 'disambiguationspage' doesn't exists

https://gerrit.wikimedia.org/r/223879