matej_suchanek created this task.
matej_suchanek added a subscriber: matej_suchanek.
matej_suchanek added projects: Pywikibot-Wikidata, Wikidata.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  Per [[ 
https://wikidata.org/wiki/Special:PermaLink/247512558#Example_8:_Add_a_qualifier
 | local documentation ]], qualifiers can be added using:
  
    qualifier = pywikibot.Claim(repo, u'P678')
    target = pywikibot.ItemPage(repo, "Q7432")
    qualifier.setTarget(target)
    claim.addQualifier(qualifier)
  
  Doing so crashes the bot:
  
     [...]
      claim.addQualifier(qualifier)
    File "...\pywikibot\page.py", line 4367, in addQualifier
      data = self.repo.editQualifier(self, qualifier, **kwargs)
    File "...\pywikibot\site.py", line 1272, in callee
      return fn(self, *args, **kwargs)
    File "...\pywikibot\site.py", line 6691, in editQualifier
      data = req.submit()
    File "...\pywikibot\data\api.py", line 2169, in submit
      raise APIError(**result['error'])
    pywikibot.data.api.APIError: noclaim: The claim parameter must be set 
[help:See
    https://www.wikidata.org/w/api.php for API usage]
    <class 'pywikibot.data.api.APIError'>
    CRITICAL: Closing network session.
  
  This is the call:
    data = self.repo.editQualifier(self, qualifier, **kwargs)
  and this is what is called elsewhere:
    def editQualifier(self, claim, qualifier, new=False, bot=True, **kwargs):
  
  I'm not sure but think this is the place where the error comes from.
  
  Note that this blocks my bot's [[ 
https://www.wikidata.org/wiki/Wikidata:Requests_for_permissions/Bot/MatSuBot_2 
| new task ]]. (I've also adjusted a little my local files to evade some errors 
about which I will create more tickets. These changes are only little and 
should not impact the given methods; if they do, I'm sorry to have opened this 
ticket.)

TASK DETAIL
  https://phabricator.wikimedia.org/T112577

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: matej_suchanek
Cc: Aklapper, matej_suchanek, pywikibot-bugs-list, Wikidata-bugs, aude, 
Ricordisamoa



_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to