Skip to content

Commit a77b9d3

Browse files
committed
Python 3 preparation: use bytes in _gen_nonce.
1 parent 3053677 commit a77b9d3

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 uchr
53+
from roundup.anypy.strings import s2b, uchr
5454

5555
def initialiseSecurity(security):
5656
'''Create some Permissions and Roles on the security object
@@ -402,7 +402,7 @@ def __init__(self, instance, request, env, form=None, translator=None):
402402
def _gen_nonce(self):
403403
""" generate a unique nonce """
404404
n = '%s%s%s'%(random.random(), id(self), time.time() )
405-
n = hashlib.sha256(n).hexdigest()
405+
n = hashlib.sha256(s2b(n)).hexdigest()
406406
return n
407407

408408
def setTranslator(self, translator=None):

0 commit comments

Comments
 (0)