Last modified: 2014-10-21 16:34:40 UTC
Wikibase API does not handle page titles with sections. ItemPage.fromPage currently sends them. Compare https://www.wikidata.org/w/api.php?action=wbgetentities&sites=enwiki&titles=New%20York%20City with https://www.wikidata.org/w/api.php?action=wbgetentities&sites=enwiki&titles=New%20York%20City%23foo ItemPage.fromPage needs to either raise an error, or strip the section from the title.
This is one of the problems causing an error with: python2.7 pwb.py harvest_template.py -family:wikipedia -lang:it -page:"Stazione di Redipuglia" -template:Navbox_ferrovia "Stazione precedente" P197 "Stazione successiva" P197 ... File "scripts/harvest_template.py", line 98, in _template_link_target if not item or not linked_item.exists(): AttributeError: 'NoneType' object has no attribute 'exists' The other is that 'if not item' should probably be 'if not linked_item'
Change 167819 had a related patch set uploaded by John Vandenberg: ItemPage.fromPage should strip #section https://gerrit.wikimedia.org/r/167819
Change 167819 merged by jenkins-bot: ItemPage.fromPage should strip #section https://gerrit.wikimedia.org/r/167819
I approved the patch set. Thanks for hunting this down and fixing it! python2.7 pwb.py harvest_template.py -family:w"Stazione di Redipuglia" -template:Navbox_ferrovia "Stazione precedente" P197 "Stazione successiva" P197 Finding redirects... Retrieving 1 pages from wikipedia:it. Working on u'Stazione di Redipuglia' Adding P197 --> [[wikidata:Q3743679]] Adding P197 --> [[wikidata:Q3743679]] WARNING: API warning (wbcreateclaim)of unknown format: {u'messages': [{u'html': {u'*': u'Your edit was patched into the latest version.'}, u'name': u'wikibase-conflict-patched', u'parameters': []}]} <--- That's another bug/feature ;-)