From 9a6d422fd8aeb53019642f03805fc950ed11a700 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 9 Nov 2021 16:01:45 -0500 Subject: [PATCH] Fix the python3 of rsp read --- misc/fixsmmexpiry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/fixsmmexpiry.py b/misc/fixsmmexpiry.py index fdcb4351..5a08fdaa 100644 --- a/misc/fixsmmexpiry.py +++ b/misc/fixsmmexpiry.py @@ -28,7 +28,7 @@ if 'authResult>1' in rspdata: restorepwd = True w.request('POST', '/data/login', bdata, headers) rsp = w.getresponse() - rspdata = rsp.read() + rspdata = rsp.read().decode('utf8') if 'renew_account' in rspdata: restorepwd = True tokens = fromstring(rspdata) @@ -36,10 +36,10 @@ if 'renew_account' in rspdata: w.set_header('ST2', st2) w.request('POST', '/data/changepwd', 'oripwd={0}&newpwd={1}'.format(os.environ['SMMPASS'], tmppassword)) rsp = w.getresponse() - rspdata = rsp.read() + rspdata = rsp.read().decode('utf8') w.request('POST', '/data/login', bdata, headers) rsp = w.getresponse() - rspdata = rsp.read() + rspdata = rsp.read().decode('utf8') if 'authResult>0' in rspdata: tokens = fromstring(rspdata) st2 = tokens.findall('st2')[0].text