From c70d455693665a29ab0eb31a3929b98b42bfe2ea Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 7 Jan 2010 10:18:14 +0000 Subject: [PATCH] for python-2.6 --- PLC/Auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PLC/Auth.py b/PLC/Auth.py index 9fea3e3..b11e855 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -256,7 +256,8 @@ class BootAuth(Auth): # We encode in UTF-8 before calculating the HMAC, which is # an 8-bit algorithm. - digest = hmac.new(key, msg.encode('utf-8'), sha).hexdigest() + # python 2.6 insists on receiving a 'str' as opposed to a 'unicode' + digest = hmac.new(str(key), msg.encode('utf-8'), sha).hexdigest() if digest != auth['value']: raise PLCAuthenticationFailure, "Call could not be authenticated" -- 2.43.0