Xqt submitted this change.
[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.