Page MenuHomePhabricator

BasePage.iterlanglinks does not respect total parameter if cache is found
Closed, ResolvedPublicBUG REPORT

Description

interface

def iterlanglinks(
        self,
        total: int | None = None,
        include_obsolete: bool = False,
    ) -> Iterable[pywikibot.Link]:

Problem
total is not respected if _langlinks is given:

if hasattr(self, '_langlinks'):
    return iter(self.langlinks(include_obsolete=include_obsolete))

Event Timeline

Xqt renamed this task from APISite.iterlanglinks does not respect total parameter if cache is found to BasePage.iterlanglinks does not respect total parameter if cache is found.Apr 6 2026, 3:17 PM
Xqt triaged this task as High priority.
Xqt changed the subtype of this task from "Task" to "Bug Report".

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

[pywikibot/core@master] [bugfix] enable total parameter if '_langlinks' cache is given

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

Change #1268232 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] enable total parameter if '_langlinks' cache is given

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