changeset 5430:407c75df2851

Python 3 preparation: use bytes in _gen_nonce.
author Joseph Myers <jsm@polyomino.org.uk>
date Wed, 25 Jul 2018 10:09:19 +0000
parents daa19de102a2
children 4c724ad7b849
files roundup/cgi/client.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/client.py	Wed Jul 25 09:56:22 2018 +0000
+++ b/roundup/cgi/client.py	Wed Jul 25 10:09:19 2018 +0000
@@ -50,7 +50,7 @@
 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
@@ -402,7 +402,7 @@
     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):

Roundup Issue Tracker: http://roundup-tracker.org/