From be40a6fc5bba3a53336cd6c9764a2da42f6b2c08 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 20 Jun 2018 21:14:51 +0000 Subject: [PATCH 57/64] Python 3 preparation: use bytes in _gen_nonce. --- roundup/cgi/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index bdb2780..5b44d41 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -50,7 +50,7 @@ from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart import roundup.anypy.email_ -from roundup.anypy.strings import uchr +from roundup.anypy.strings import s2b, uchr def initialiseSecurity(security): '''Create some Permissions and Roles on the security object @@ -383,7 +383,7 @@ class Client: def _gen_nonce(self): """ generate a unique nonce """ n = '%s%s%s'%(random.random(), id(self), time.time() ) - n = hashlib.sha256(n).hexdigest() + n = hashlib.sha256(s2b(n)).hexdigest() return n def setTranslator(self, translator=None): -- 2.7.4