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."""

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/617798
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6d444570abf555e8a6882a99694cc864627a19f9
Gerrit-Change-Number: 617798
Gerrit-PatchSet: 2
Gerrit-Owner: Russell Blau <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Multichill <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to