summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web/auth.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2017-07-03 10:41:09 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2018-06-26 12:42:26 +0100
commit277576268c51431196a84ebd0789ad415cf4e58e (patch)
tree7c854cfa9212dd8b0501f20e63fe62afeec6cee8 /deluge/ui/web/auth.py
parent74aa0db95603b2396fe9a0f297e8d80a056be95e (diff)
downloaddeluge-277576268c51431196a84ebd0789ad415cf4e58e.tar.gz
deluge-277576268c51431196a84ebd0789ad415cf4e58e.tar.bz2
deluge-277576268c51431196a84ebd0789ad415cf4e58e.zip
[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.
Diffstat (limited to 'deluge/ui/web/auth.py')
-rw-r--r--deluge/ui/web/auth.py6
1 files changed, 3 insertions, 3 deletions
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.