jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/636427 )
Change subject: [IMPR] use put_current instead of userPut to write the page ......................................................................
[IMPR] use put_current instead of userPut to write the page
Also remove exception handling which is done by BaseBot._save_page already because CurrentPageBot ignores save related errors and does not raise the exception.
Change-Id: I096e972fda42d7daa832fb52d5e50c467cd6e593 --- M scripts/noreferences.py 1 file changed, 2 insertions(+), 15 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/noreferences.py b/scripts/noreferences.py index fec70ba..8da4116 100755 --- a/scripts/noreferences.py +++ b/scripts/noreferences.py @@ -728,25 +728,12 @@ try: text = page.text except pywikibot.LockedPage: - pywikibot.warning('Page {0} is locked?!' + pywikibot.warning('Page {} is locked?!' .format(page.title(as_link=True))) return
if self.lacksReferences(text): - newText = self.addReferences(text) - try: - self.userPut( - page, page.text, newText, summary=self.comment) - except pywikibot.EditConflict: - pywikibot.warning('Skipping {0} because of edit conflict' - .format(page.title(as_link=True))) - except pywikibot.SpamblacklistError as e: - pywikibot.warning( - 'Cannot change {0} because of blacklist entry {1}' - .format(page.title(as_link=True), e.url)) - except pywikibot.LockedPage: - pywikibot.warning('Skipping {0} (locked page)' - .format(page.title(as_link=True))) + self.put_current(self.addReferences(text), summary=self.comment)
def main(*args) -> None:
pywikibot-commits@lists.wikimedia.org