Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/293905

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

[bugfix] lstrip() 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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/05/293905/1

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: newchange
Gerrit-Change-Id: I4958cba789f8a0e997a0dee1204b0d1119bd1931
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to