Xqt submitted this change.

View Change


Approvals: Matěj Suchánek: Looks good to me, approved Xqt: Verified; Looks good to me, approved
[bugfix] newpages should not fail for hidden comments

Use empty string if a comment is hidden

Bug: T332657
Change-Id: Ifbae91e85790820d895a66dd62fff4707842fc89
---
M pywikibot/site/_generators.py
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index 4752b45..966c76e 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -1,6 +1,6 @@
"""Objects representing API generators to MediaWiki site."""
#
-# (C) Pywikibot team, 2008-2022
+# (C) Pywikibot team, 2008-2023
#
# Distributed under the terms of the MIT license.
#
@@ -1874,7 +1874,7 @@
yield (newpage, pageitem)
else:
yield (newpage, pageitem['timestamp'], pageitem['newlen'],
- '', pageitem['user'], pageitem['comment'])
+ '', pageitem['user'], pageitem.get('comment', ''))

def querypage(self, special_page, total=True):
"""Yield Page objects retrieved from Special:{special_page}.

To view, visit change 904769. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ifbae91e85790820d895a66dd62fff4707842fc89
Gerrit-Change-Number: 904769
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia@gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged