jenkins-bot has submitted this change and it was merged.
Change subject: (bug 62916) Only add hash if it is not None. ......................................................................
(bug 62916) Only add hash if it is not None.
A newly created Claim seems to have claim.hash=None now. This leads site.py to add "hash" to the query and results in an API Error of previously working code.
Change-Id: I627ed24ed4e71abb560376b1ec2655852134285e --- M pywikibot/site.py 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 78196a5..0d1e92d 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3865,7 +3865,9 @@ params['baserevid'] = claim.on_item.lastrevid if bot: params['bot'] = 1 - if not new and hasattr(qualifier, 'hash'): + if (not new and + hasattr(qualifier, 'hash') and + qualifier.hash is not None): params['snakhash'] = qualifier.hash params['token'] = self.token(claim, 'edit') #build up the snak
pywikibot-commits@lists.wikimedia.org