Page MenuHomePhabricator

BasePage.exists() documentation is incorrect
Open, HighPublicBUG REPORT

Description

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

>>> page = pywikibot.Page(site, "Wikidata:Requests for deletions#FakeHeading")
>>> page.exists()
True

What happens?:

The documentation claims that it will return False if a heading is included but the heading does not exist on the page. However, this behavior does not happen.

What should have happened instead?:

Ideally, if the heading did not exist, it would return False. However, since templates can add section headings, pywikibot would need to parse the generated HTML to determine if the section header exists, or alternatively this line can be removed from the documentation.

Software version:
Pywikibot 2

Other information (browser name/version, screenshots, etc.):

Details

Related Changes in Gerrit:

Related Objects

Event Timeline

Xqt renamed this task from ItemPage.exists() documentation is incorrect to BasePage.exists() documentation is incorrect.Apr 9 2023, 9:57 AM

Change #1328300 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] Fix BasePage.exists documentation

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

Change #1328300 merged by Xqt:

[pywikibot/core@master] Fix BasePage.exists documentation

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