Page MenuHomePhabricator

harvest_template.py encounters an issue while parsing some wikilinks
Closed, DuplicatePublic

Description

example 1

>>> Comuna Egorovca, Fălești <<<
Adding P150 --> [[wikidata:Q2440250]]
ERROR: Query on [[ro:Catranîc (loc. st. c. f.), Fălești]] returned data on 'Catranîc (loc. st. c. f.
), Fălești'
Traceback (most recent call last):
  File "pywikibot\bot.py", line 1948, in run
    self.treat(page, item)
  File ".\scripts\harvest_template.py", line 183, in treat
    linked_item = self._template_link_target(item, link_text)
  File ".\scripts\harvest_template.py", line 105, in _template_link_target
    if not linked_page.exists():
  File "pywikibot\page.py", line 756, in exists
    return self.site.page_exists(self)
  File "pywikibot\site.py", line 2988, in page_exists
    return page.pageid > 0
  File "pywikibot\page.py", line 255, in pageid
    self.site.loadpageinfo(self)
  File "pywikibot\site.py", line 2914, in loadpageinfo
    self._update_page(page, query)
  File "pywikibot\site.py", line 2900, in _update_page
    raise InconsistentTitleReceived(page, pageitem['title'])
InconsistentTitleReceived: Query on [[ro:CatranГ®c (loc.В st.В c.В f.), FДѓleИ™ti]] returned data on
 'CatranГ®c (loc. st. c. f.), FДѓleИ™ti'

example 2

>>> Comuna Cobasna, Stînga Nistrului <<<
Adding P150 --> [[wikidata:Q2632586]]
Adding P150 --> [[wikidata:Q12158885]]
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': []}]}
ERROR: Query on [[ro:Cobasna (loc. st. c. f.), Stînga Nistrului]] returned data on 'Cobasna (loc. st
. c. f.), Stînga Nistrului'
Traceback (most recent call last):
  File "pywikibot\bot.py", line 1948, in run
    self.treat(page, item)
  File ".\scripts\harvest_template.py", line 183, in treat
    linked_item = self._template_link_target(item, link_text)
  File ".\scripts\harvest_template.py", line 105, in _template_link_target
    if not linked_page.exists():
  File "pywikibot\page.py", line 756, in exists
    return self.site.page_exists(self)
  File "pywikibot\site.py", line 2988, in page_exists
    return page.pageid > 0
  File "pywikibot\page.py", line 255, in pageid
    self.site.loadpageinfo(self)
  File "pywikibot\site.py", line 2914, in loadpageinfo
    self._update_page(page, query)
  File "pywikibot\site.py", line 2900, in _update_page
    raise InconsistentTitleReceived(page, pageitem['title'])
InconsistentTitleReceived: Query on [[ro:Cobasna (loc.В st.В c.В f.), StГ®nga Nistrului]] returned d
ata on 'Cobasna (loc. st. c. f.), StГ®nga Nistrului'