jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/617798 )
Change subject: Skip data_dict if it does not contain a 'title' attribute. ......................................................................
Skip data_dict if it does not contain a 'title' attribute.
Change-Id: I6d444570abf555e8a6882a99694cc864627a19f9 --- M pywikibot/data/api.py 1 file changed, 8 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 11b8826..a5855af 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -3000,9 +3000,14 @@ for data_dict in super(PropertyGenerator, self)._extract_results( resultdata ): - d = self._previous_dicts.setdefault(data_dict['title'], data_dict) - if d is not data_dict: - self._update_old_result_dict(d, data_dict) + if 'title' in data_dict: + d = self._previous_dicts.setdefault(data_dict['title'], + data_dict) + if d is not data_dict: + self._update_old_result_dict(d, data_dict) + else: + pywikibot.warn('Skipping result without title: ' + + str(data_dict))
def _fully_retrieved_data_dicts(self, resultdata): """Yield items of self._previous_dicts that are not in resultdata."""
pywikibot-commits@lists.wikimedia.org