From a5fa0e5e58d903e16149e2919fa989f85864a7a5 Mon Sep 17 00:00:00 2001 From: Kurt Jensen Date: Thu, 14 Nov 2024 09:05:36 -0500 Subject: [PATCH] COMPUTE-448 Fix nonce generation for python3 (#1414) --- src/python/dxpy/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/dxpy/utils/__init__.py b/src/python/dxpy/utils/__init__.py index fdc360cd24..734417af59 100644 --- a/src/python/dxpy/utils/__init__.py +++ b/src/python/dxpy/utils/__init__.py @@ -292,10 +292,10 @@ class Nonce: ''' def __init__(self): try: - self.nonce = "%s%f" % (str(binascii.hexlify(os.urandom(32))), time.time()) + self.nonce = "%s%f" % (binascii.hexlify(os.urandom(32)).decode('utf-8'), time.time()) except: random.seed(time.time()) - self.nonce = "%s%f" % (str(random.getrandbits(8*26)), time.time()) + self.nonce = "%s%f" % (random.getrandbits(8*26), time.time()) def __str__(self): return self.nonce