https://gerrit.wikimedia.org/r/#/c/80706/


[bugs:#1653] Pagegenerator WikidataItemGenerator does not work with RefferingPageGenerator

Status: open
Created: Sat Aug 10, 2013 11:36 PM UTC by Sk!d
Last Updated: Sat Aug 24, 2013 07:34 AM UTC
Owner: nobody

There must be a bug in Pagegenrators this code does not work:

referredPage = pywikibot.page.PropertyPage(pywikibot.Site().data_repository(), "Property:P21")
pagegenrator = pywikibot.pagegenerators.WikidataItemGenerator(pywikibot.pagegenerators.ReferringPageGenerator(referredPage, withTemplateInclusion=False, content=False))

if you iterate over pagegenerator you get the stacktrace:

File "X\core\wikidatascripts\itemfix.py", line 34, in
if int(item.title()[1:]) <176:
File "X\core\pywikibot\page.py", line 2264, in title
self._link._text = self.getID()
File "X\core\pywikibot\page.py", line 2357, in getID
self.get(force=force)
File "X\core\pywikibot\page.py", line 2486, in get
super(ItemPage, self).get(force=force, args)
File "X\core\pywikibot\page.py", line 2317, in get
data = self.repo.loadcontent(self.__defined_by(),
args)
File "X\core\pywikibot\site.py", line 3373, in loadcontent
data = req.submit()
File "X\core\pywikibot\data\api.py", line 393, in submit
raise APIError(code, info, **result["error"])
pywikibot.data.api.APIError: param-missing: Either provide the item "ids" or pairs of "sites" and "titles" for corresponding pages

a work around is by iterating over referredPage.getReferences()


Sent from sourceforge.net because Pywikipedia-bugs@lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.