Page MenuHomePhabricator

flow.Board.topics continuation breaks when reverse=True
Open, HighPublic


When using board.topics(reverse=True), after the first batch has been iterated (default is 100 topics), the generator fails with KeyError.

from pywikibot.flow import Board
site = pywikibot.Site('mediawiki', 'mediawiki')
board = Board(site, 'Project talk:Sandbox/Flow test')
topics_list = board.topics(reverse=True)
for topic in topics_list:

results in

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "pywikibot/", line 139, in topics
    cont_args = self._parse_url(data['links']['pagination'])
  File "pywikibot/", line 93, in _parse_url
    rule = links['fwd']
KeyError: u'fwd'

Event Timeline

jayvdb created this task.Jun 21 2016, 4:45 PM
Restricted Application added subscribers: pywikibot-bugs-list, Zppix, Aklapper. · View Herald TranscriptJun 21 2016, 4:45 PM

This was a remarkably simple oversight on my part. When the topic list is reversed, the proper key is "rev" rather than "fwd".

happy5214 triaged this task as High priority.May 31 2017, 12:30 AM