Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/904769 )
Change subject: [bugfix] newpages should not fail for hidden comments ......................................................................
[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(-)
Approvals: Matěj Suchánek: Looks good to me, approved Xqt: Verified; Looks good to me, approved
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}.
pywikibot-commits@lists.wikimedia.org