Running some script writing to wikidata, usually harvest_template.py or claimit.py or some own script
python pwb.py claimit "-cat:wikipedie:Rozcestníky "P31" "Q4167410"
What happens?:
>>> Afterparty <<<
>>> Q1770155 <<<
Adding P31 --> [[wikidata:Q4167410]]
>>> Aftershock <<<
>>> Against the Grain <<<
Exception in thread Put-Thread:
Traceback (most recent call last):
File "C:\Python\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Python\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "D:\pwb\pywikibot\__init__.py", line 400, in async_manager
request(*args, **kwargs)
File "D:\pwb\pywikibot\page\_decorators.py", line 32, in handle
func(self, *args, **kwargs)
File "D:\pwb\pywikibot\page\_wikibase.py", line 908, in addClaim
self.repo.addClaim(self, claim, bot=bot, **kwargs)
File "D:\pwb\pywikibot\site\_decorators.py", line 93, in callee
return fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\pwb\pywikibot\site\_datasite.py", line 379, in addClaim
'token': self.tokens['csrf'],
~~~~~~~~~~~^^^^^^^^
File "D:\pwb\pywikibot\site\_tokenwallet.py", line 60, in __getitem__
raise KeyError(
KeyError: "Invalid token 'csrf' for user 'JAnDbot' on wikidata:wikidata wiki."
>>> Agassiz <<<and no edit is made, script freeze when there is queue of 63 edits
What should have happened instead?:
script sjhould edit wikidata item.
sometimes, when I first run e.g newpage.py script have valid token and edits are made.