https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
Bug ID: 72317 Summary: ItemPage.fromPage should not send page title with section Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: Wikidata Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: jayvdb@gmail.com Web browser: --- Mobile Platform: ---
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&...
with
https://www.wikidata.org/w/api.php?action=wbgetentities&sites=enwiki&...
ItemPage.fromPage needs to either raise an error, or strip the section from the title.
https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maarten@mdammers.nl
--- Comment #1 from John Mark Vandenberg jayvdb@gmail.com --- 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'
https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
--- Comment #2 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 167819 had a related patch set uploaded by John Vandenberg: ItemPage.fromPage should strip #section
https://gerrit.wikimedia.org/r/167819
https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
--- Comment #3 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 167819 merged by jenkins-bot: ItemPage.fromPage should strip #section
https://gerrit.wikimedia.org/r/167819
https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
--- Comment #4 from Maarten Dammers maarten@mdammers.nl --- 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 ;-)
https://bugzilla.wikimedia.org/show_bug.cgi?id=72317
Maarten Dammers maarten@mdammers.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED Resolution|--- |FIXED
pywikipedia-bugs@lists.wikimedia.org