albertvillanova / WikidataBot

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

[scripts] transfer_infotable crashes with APIError #47

Closed albertvillanova closed 4 years ago

albertvillanova commented 4 years ago

wikipedia:ca:Jeannot Ahoussou-Kouadio

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in add_statements(item, statements, summary) 1089 logger.info("Try to add new statements to main item") 1090 for statement in statements: -> 1091 add_statement(item, statement, summary=summary) 1092 1093

~\projects\wikidata\WikidataBot\scripts\transfer_infotable.py in add_statement(item, new_statement, summary) 1097 if not duplicated: 1098 logger.info(f"Add statement: {new_statement}") -> 1099 item.add_statement(new_statement, summary=summary) 1100 1101

~\projects\wikidata\WikidataBot\wikidatabot\models.py in add_statement(self, statement, summary) 316 data = {'claims': [statement._statement.toJSON()]} # add the statement on property: use [] 317 # to overwrite statement on property: do not use [] # FALSE; use snak instead --> 318 response = repo.editEntity(identification, data, summary=summary) 319 # response is a dict: {'entity': {'labels': {'ca': {'language': 'ca', 'value': 'Joaquim Abargues i Feliu'}}, 320 # 'descriptions': {}, 'aliases': {}, 'sitelinks': {'cawiki': {'site': 'cawiki',

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\tools__init.py in wrapper(*args, *kw) 1742 cls, depth) 1743 del kw[old_arg] -> 1744 return obj(args, **kw) 1745 1746 if not debug:

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\site.py in callee(self, *args, *kwargs) 1344 raise Exception('Not implemented') 1345 -> 1346 return fn(self, args, **kwargs) 1347 1348 if not debug:

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\site.py in editEntity(self, entity, data, bot, kwargs) 8048 params['data'] = json.dumps(data) 8049 req = self._simple_request(params) -> 8050 data = req.submit() 8051 return data 8052

c:\users\avi14827\projects\wikidata\pywikibot\pywikibot\data\api.py in submit(self) 2078 % result) 2079 -> 2080 raise APIError(**result['error']) 2081 except TypeError: 2082 raise RuntimeError(result)

APIError: modification-failed: Data value corrupt: Month out of allowed bounds [messages:[{'name': 'wikibase-validator-bad-value', 'parameters': ['Month out of allowed bounds'], 'html': {'*': 'Data value corrupt: Mon th out of allowed bounds'}}]; help:See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce > for notice of API deprecations and breaking changes.]