a pass on some explicit encode calls that are obviously wrong in python3; some may...
[plcapi.git] / PLC / Sessions.py
index 511ed93..8dacc2e 100644 (file)
@@ -50,9 +50,9 @@ class Session(Row):
                 session.delete(commit)
 
             # Generate 32 random bytes
-            bytes = random.sample(range(0, 256), 32)
+            int8s = random.sample(range(0, 256), 32)
             # Base64 encode their string representation
-            self['session_id'] = base64.b64encode("".join(map(chr, bytes)))
+            self['session_id'] = base64.b64encode(bytes(int8s))
             # Force insert
             insert = True