jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/336918 )
Change subject: archivebot.py: fix Unicode encodings in py2 and py3 ......................................................................
archivebot.py: fix Unicode encodings in py2 and py3
In python2: - fix UnicodeDecodeError
In python3: - fix md5(), hashes work on bytes, not on characters
Bug: T157045 Change-Id: I2ac8708958ce999c5b56e7ad159601908cdce945 --- M scripts/archivebot.py 1 file changed, 4 insertions(+), 2 deletions(-)
Approvals: Zhuyifei1999: Looks good to me, but someone else must approve jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/scripts/archivebot.py b/scripts/archivebot.py index 785d6af..a20cbf1 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -544,8 +544,10 @@ def key_ok(self): """Return whether key is valid.""" s = md5() - s.update(self.salt + '\n') - s.update(self.page.title().encode('utf8') + '\n') + s.update(self.salt.encode('utf-8')) + s.update(b'\n') + s.update(self.page.title().encode('utf8')) + s.update(b'\n') return self.get_attr('key') == s.hexdigest()
def load_config(self):
pywikibot-commits@lists.wikimedia.org