Open ottonemo opened 6 years ago
In utils.py there is still one line that uses unicode() which will fail in python3. Patch:
utils.py
unicode()
@@ -17,7 +17,10 @@ def validate_hub_signature(app_secret, r pass else: digest_module = getattr(hashlib, hash_method) - hmac_object = hmac.new(str(app_secret), unicode(request_payload), digest_module) + if six.PY2: + hmac_object = hmac.new(str(app_secret), unicode(request_payload), digest_module) + else: + hmac_object = hmac.new(bytearray(app_secret, 'utf8'), request_payload, digest_module) generated_hash = hmac_object.hexdigest() if hub_signature == generated_hash: return True
In
utils.py
there is still one line that usesunicode()
which will fail in python3. Patch: