From 277576268c51431196a84ebd0789ad415cf4e58e Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 3 Jul 2017 10:41:09 +0100 Subject: [Py2to3] Replace deprecated base64.(de|en)codestring * In Py3 base64.encodestring is deprecated so rather than use the Py3 only encodebytes instead use b64encode. The other advantage is that with issue a consistent TypeError is raised that we can catch. --- deluge/ui/web/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'deluge/ui/web/auth.py') diff --git a/deluge/ui/web/auth.py b/deluge/ui/web/auth.py index 3ab8ccf9f..3929f949f 100644 --- a/deluge/ui/web/auth.py +++ b/deluge/ui/web/auth.py @@ -143,11 +143,11 @@ class Auth(JSONComponent): elif 'old_pwd_md5' in config.config: # We are using the 1.1 webui auth method log.debug('Received a password via the 1.1 auth method') - from base64 import decodestring + from base64 import b64decode m = hashlib.md5() - m.update(decodestring(config['old_pwd_salt'])) + m.update(b64decode(config['old_pwd_salt'])) m.update(password.encode('utf8')) - if m.digest() == decodestring(config['old_pwd_md5']): + if m.digest() == b64decode(config['old_pwd_md5']): # We want to move the password over to sha1 and remove # the old passwords from the config file. -- cgit