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

Change subject: archivebot.py: count size by bytes instead of the number of 
characters
......................................................................


archivebot.py: count size by bytes instead of the number of characters

Using UTF-8 encoded bytes conforms with units used on MediaWiki history
pages and with the bot's documentations in the script and on-wiki.

Change-Id: I0f1170de4fb9856afbb63aa8e654dac5c9de0884
---
M scripts/archivebot.py
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index eea5189..407bd91 100644
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -215,7 +215,7 @@
             self.timestamp = max(self.timestamp, timestamp)
 
     def size(self):
-        return len(self.title) + len(self.content) + 12
+        return len(self.title.encode('utf-8')) + 
len(self.content.encode('utf-8')) + 12
 
     def toText(self):
         return "== " + self.title + ' ==\n\n' + self.content
@@ -291,7 +291,7 @@
         return self.full
 
     def size(self):
-        return len(self.header) + sum([t.size() for t in self.threads])
+        return len(self.header.encode('utf-8')) + sum(t.size() for t in 
self.threads)
 
     def update(self, summary, sortThreads=False):
         if sortThreads:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f1170de4fb9856afbb63aa8e654dac5c9de0884
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Whym <w...@whym.org>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
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