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}.

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/904769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ifbae91e85790820d895a66dd62fff4707842fc89
Gerrit-Change-Number: 904769
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to