jenkins-bot has submitted this change and it was merged.
Change subject: LogeventsPageGenerator: skip problematic entries ......................................................................
LogeventsPageGenerator: skip problematic entries
If there is an exception while instantiating a Page for a LogEntry, report the error and skip it.
Bug: T78152 Change-Id: I2586dbd18b346f8f2f9c78dd6f50d96b2bf6327c --- M pywikibot/pagegenerators.py 1 file changed, 7 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 4d3e487..2294b46 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -759,7 +759,13 @@ site = pywikibot.Site() for entry in site.logevents(total=total, logtype=logtype, user=user, namespace=namespace): - yield entry.title() + try: + yield entry.title() + except KeyError as e: + pywikibot.warning(u'LogeventsPageGenerator: ' + u'failed to load page for %r; skipping' + % entry.data) + pywikibot.exception(e)
@deprecated("LogeventsPageGenerator")
pywikibot-commits@lists.wikimedia.org