Merlijn van Deen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223863

Change subject: Skip RC entries without a title
......................................................................

Skip RC entries without a title

The title in a log entry may have been suppressed,
and wont appear in the item data.

Bug: T78152
Change-Id: I2b27813eb2b6861d606177f69d2eefa813c0cbd0
---
M pywikibot/pagegenerators.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/63/223863/1

diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 12e7523..dd96d21 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -994,6 +994,9 @@
                                    showPatrolled=showPatrolled,
                                    topOnly=topOnly, step=step, total=total,
                                    user=user, excludeuser=excludeuser):
+        # The title in a log entry may have been suppressed
+        if 'title' not in item and item['type'] == 'log':
+            continue
         yield pywikibot.Page(pywikibot.Link(item["title"], site))
 
 
@@ -2047,6 +2050,9 @@
     from pywikibot.comms.rcstream import site_rc_listener
 
     for entry in site_rc_listener(site, total=total):
+        # The title in a log entry may have been suppressed
+        if 'title' not in entry and entry['type'] == 'log':
+            continue
         page = pywikibot.Page(site, entry['title'], entry['namespace'])
         page._rcinfo = entry
         yield page

-- 
To view, visit https://gerrit.wikimedia.org/r/223863
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b27813eb2b6861d606177f69d2eefa813c0cbd0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to