X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FSessions.py;fp=PLC%2FSessions.py;h=8dacc2ef5c16b0944a5d32c04151aae2567a998c;hb=aed64f31afdf04bdd6e22f3b1efdd61a2d63174a;hp=511ed939eca1aaac0619179d48066af17dcf760b;hpb=b92fd6505ef9a6e2e3532add89f0eb368bd4e2e2;p=plcapi.git diff --git a/PLC/Sessions.py b/PLC/Sessions.py index 511ed93..8dacc2e 100644 --- a/PLC/Sessions.py +++ b/PLC/Sessions.py @@ -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