albertvillanova / WikidataBot

Wikidata bot
http://www.wikidata.org/wiki/User:AVMbot
0 stars 0 forks source link

[scripts] transfer_infotable crashes with InvalidTitle #48

Closed albertvillanova closed 4 years ago

albertvillanova commented 4 years ago

wikipedia:ca:Andreu II d'Hongria

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in create_position_statements(positions) 1104 # Parse each position 1105 for position in positions: -> 1106 position_claim, qualifiers = parse_position(position) 1107 if not position_claim: 1108 # 1. Create the maximum number of statements

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in parse_position(position) 1000 logger.error(f"Malformed position does not contain 'carrec': {position}") 1001 return None, [] -> 1002 position_claim, qualifiers = parse_position_value(position['carrec']) 1003 if not position_claim: 1004 logger.error(f"Skip parsing position qualifiers: no position claim found for {position['carrec']}")

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in parse_position_value(position_value) 857 match = re.match(regex, position_value, re.I) 858 if match: --> 859 position_item = get_office_held_by_head_from_link(match.group('organization'), of='state') 860 elif position_value.lower().startswith("ambaixador"): 861 # Join multi-word countries

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in get_office_held_by_head_from_link(link, of) 581 if link.lower().startswith("llista"): 582 logger.warning(f"Link is a list") --> 583 organization_item = get_item_from_page_link(link) 584 if not organization_item: 585 logger.error(f"No organization item found from link {link}")

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in get_item_from_page_link(link, langs) 514 def get_item_from_page_link(link, langs=None): 515 logger.info(f"Get item from page link {link}") --> 516 page = get_page_from_link(link, langs=langs) 517 if not page: 518 logger.error(f"No Wikidata item because no Wikipedia page from page link: {link}")

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in get_page_from_link(link, langs) 491 site = sites[lang] 492 page = pw.Page(pw.Link(link, source=site)) --> 493 if page.isRedirectPage(): 494 page = page.getRedirectTarget() 495 if page.exists():

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\page.py in isRedirectPage(self) 824 def isRedirectPage(self): 825 """Return True if this is a redirect, False if not or not existing.""" --> 826 return self.site.page_isredirect(self) 827 828 def isStaticRedirect(self, force=False):

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\page.py in site(self) 223 @rtype: pywikibot.Site 224 """ --> 225 return self._link.site 226 227 def version(self):

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\page.py in site(self) 6180 """ 6181 if not hasattr(self, '_site'): -> 6182 self.parse() 6183 return self._site 6184

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\page.py in parse(self) 6135 if m: 6136 raise pywikibot.InvalidTitle( -> 6137 '%s contains illegal char(s) %s' % (repr(t), repr(m.group(0)))) 6138 6139 # Pages with "/./" or "/../" appearing in the URLs will

InvalidTitle: 'Hongria
Duc de Croàcia i Dalmàcia' contains illegal char(s) '<'