List of steps to reproduce (step by step, including full links if applicable):
pwb dataextend -simulate Q42
What happens?:
Found here: VIAF ID: 171149066383365600907 date of birth: 1952 date of death: 2001 ISNI: 0000 0000 8045 6315 Save this? (Y/n) y Adding VIAF ID: 171149066383365600907 SIMULATION: wbsetclaim action blocked. Sourcing VIAF ID: 171149066383365600907 SIMULATION: wbsetreference action blocked. 0 pages read 0 pages written 0 pages skipped Execution time: 50 seconds Script terminated by exception: ERROR: KeyError: 'reference' Traceback (most recent call last): File "C:\pwb\GIT\core\pwb.py", line 499, in <module> main() File "C:\pwb\GIT\core\pwb.py", line 483, in main if not execute(): File "C:\pwb\GIT\core\pwb.py", line 466, in execute run_python_file(filename, script_args, module) File "C:\pwb\GIT\core\pwb.py", line 143, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File ".\scripts\dataextend.py", line 15458, in <module> main() File ".\scripts\dataextend.py", line 15454, in main bot.run() File "C:\pwb\GIT\core\pywikibot\bot.py", line 1571, in run self.treat(page) File ".\scripts\dataextend.py", line 999, in treat createdclaim.addSources( File "C:\pwb\GIT\core\pywikibot\page\_wikibase.py", line 1706, in addSources claim.hash = data['reference']['hash'] KeyError: 'reference' CRITICAL: Exiting due to uncaught exception <class 'KeyError'> C:\pwb\GIT\core>
The following sourcedata is tried to be used with addSources:
[Claim.fromJSON(DataSite("wikidata", "wikidata"), {'mainsnak': {'snaktype': 'value', 'property': 'P854', 'datatype': 'url', 'datavalue': {'value': 'https://authority.bibsys.no/authority/rest/authorities/html/90196888', 'type': 'string'}}, 'type': 'statement', 'rank': 'normal'}), Claim.fromJSON(DataSite("wikidata", "wikidata"), {'mainsnak': {'snaktype': 'value', 'property': 'P1015', 'datatype': 'external-id', 'datavalue': {'value': '90196888', 'type': 'string'}}, 'type': 'statement', 'rank': 'normal'}), Claim.fromJSON(DataSite("wikidata", "wikidata"), {'mainsnak': {'snaktype': 'value', 'property': 'P813', 'datatype': 'time', 'datavalue': {'value': {'time': '+00000002022-04-12T00:00:00Z', 'precision': 11, 'after': 0, 'before': 0, 'timezone': 0, 'calendarmodel': 'http://www.wikidata.org/entity/Q1985727'}, 'type': 'time'}}, 'type': 'statement', 'rank': 'normal'})]
Software version:
Pywikibot 7.2 with this patch
see also: rPWBC8a435798