jenkins-bot has submitted this change and it was merged.

Change subject: [bugfix] rstrip() strings before comparing for changes
......................................................................


[bugfix] rstrip() strings before comparing for changes

- mw does no edit when trying to add spaces or newlines at the end of a page.
  userPut() should reflect this point and should not try to show diff and
  should not try to edit the page. Finally the result of the method must not
  be True.

Bug: T137637
Change-Id: I4958cba789f8a0e997a0dee1204b0d1119bd1931
---
M pywikibot/bot.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mpaa: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 378f2b2..3558e99 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1278,7 +1278,7 @@
         @return: whether the page was saved successfully
         @rtype: bool
         """
-        if oldtext == newtext:
+        if oldtext.rstrip() == newtext.rstrip():
             pywikibot.output(u'No changes were needed on %s'
                              % page.title(asLink=True))
             return

-- 
To view, visit https://gerrit.wikimedia.org/r/293905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4958cba789f8a0e997a0dee1204b0d1119bd1931
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.w...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to