jenkins-bot has submitted this change and it was merged.
Change subject: Use hashlib library instead of deprecated md5 one ......................................................................
Use hashlib library instead of deprecated md5 one
Change-Id: Ib8fae9545ff1c5b05e54b0a86a1dd7d80a50361c --- M pywikibot/page.py 1 file changed, 4 insertions(+), 2 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 84c88cc..f61dc0c 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -15,6 +15,7 @@ from pywikibot import config import pywikibot.site
+import hashlib import htmlentitydefs import logging import re @@ -1645,10 +1646,11 @@ """Return image file's MD5 checksum.""" # FIXME: MD5 might be performed on incomplete file due to server disconnection # (see bug #1795683). - import md5 f = urllib.urlopen(self.fileUrl()) # TODO: check whether this needs a User-Agent header added - md5Checksum = md5.new(f.read()).hexdigest() + h = hashlib.md5() + h.update(f.read()) + md5Checksum = h.hexdigest() f.close() return md5Checksum
pywikibot-commits@lists.wikimedia.org