Page MenuHomePhabricator

Site.page_from_repository() should not raise NotimplementedError if the site is a Wikibase
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

import pywikibot
site = pywikibot.Site('wikidata')
page = site.page_from_repository('Q5296')

What happens?:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    p = site.page_from_repository('Q5296')
  File "D:\pwb\GIT\core\pywikibot\site\_apisite.py", line 1192, in page_from_repository
    raise NotImplementedError(
NotImplementedError: page_from_repository method is not implemented for Wikibase wikidata:wikidata.

What should have happened instead?:
page should be Page('Wikidata:Main Page'), see https://www.wikidata.org/wiki/Q5296

Event Timeline

Xqt triaged this task as High priority.Sep 17 2022, 3:33 PM

Change 832730 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] No longer raise NotimplementedError in Site.page_from_repository()

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

Change 832730 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] No longer raise NotimplementedError in Site.page_from_repository()

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

Xqt claimed this task.
Xqt removed a project: Patch-For-Review.