Page MenuHomePhabricator

solve_disambiguation uses slice operator for PageGenerator
Closed, ResolvedPublic

Description

In line 1021 we have this statement:

links = disambPage.linkedPages()[:1]

linkedPages() is a PageGenerator and doesn't have a __getitem__ attribute.

This is a difference to old compat where linkedPages is a list, not a generator.
There is another issue that tempatesWithParams gives a Page object in first tuple item but not a string

I am not sure whether this bug resides on other scripts, too.

Event Timeline

Xqt updated the task description. (Show Details)
Xqt added a subscriber: Dvorapa.
Xqt triaged this task as High priority.Feb 3 2018, 8:44 AM
Xqt renamed this task from solve_disambiguation uses sloce operator for PageGenerator to solve_disambiguation uses slice operator for PageGenerator.Feb 3 2018, 8:47 AM

Sure this is not a regression against compat but a difference which should be noted at compat2core.py and mayby other instructions too.

Change 407892 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Page.linkedPages() is a PageGenerator not a list

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

Change 463660 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [compat2core] Fix regressions of multiple Page methods

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

Change 463660 merged by jenkins-bot:
[pywikibot/core@master] [compat2core] Fix regressions of multiple Page methods

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

Xqt reassigned this task from Xqt to Dvorapa.

Change 407892 abandoned by Xqt:
[pywikibot/core@master] [bugfix] Page.linkedPages() is a PageGenerator not a list

Reason:

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