a pass on some explicit encode calls that are obviously wrong in python3; some may...
[plcapi.git] / PLC / Methods / ResetPassword.py
index 8036969..6a35a4d 100644 (file)
@@ -63,9 +63,9 @@ class ResetPassword(Method):
             raise PLCInvalidArgument("Cannot reset admin passwords")
 
         # Generate 32 random bytes
-        bytes = random.sample(range(0, 256), 32)
+        int8s = random.sample(range(0, 256), 32)
         # Base64 encode their string representation
-        random_key = base64.b64encode("".join(map(chr, bytes)))
+        random_key = base64.b64encode(bytes(int8s))
 
         if verification_key is not None:
             if person['verification_key'] is None or \