Skip to content

Commit f56f385

Browse files
committed
Python 3 preparation: use bytes in _gen_sid.
1 parent 231a098 commit f56f385

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/cgi/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SysCallError(Exception):
5050
from email.mime.multipart import MIMEMultipart
5151
import roundup.anypy.email_
5252

53-
from roundup.anypy.strings import s2b, uchr
53+
from roundup.anypy.strings import s2b, b2s, uchr
5454

5555
def initialiseSecurity(security):
5656
'''Create some Permissions and Roles on the security object
@@ -178,7 +178,7 @@ def _gen_sid(self):
178178
""" generate a unique session key """
179179
while 1:
180180
s = '%s%s'%(time.time(), random.random())
181-
s = binascii.b2a_base64(s).strip()
181+
s = b2s(binascii.b2a_base64(s2b(s)).strip())
182182
if not self.session_db.exists(s):
183183
break
184184

0 commit comments

Comments
 (0)