From 6c352b45bc3e6544fa9fc7f16bb79c62067a34d9 Mon Sep 17 00:00:00 2001 From: Scott Emmons Date: Thu, 10 Mar 2016 18:19:48 -0500 Subject: [PATCH] Fix "'unicode' does not have the buffer interface" error Cast signature to a str to prevent the exception: TypeError: 'unicode' does not have the buffer interface --- index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.py b/index.py index 9ebe0e6..5784742 100644 --- a/index.py +++ b/index.py @@ -90,7 +90,7 @@ def index(): if type(key) == unicode: key = key.encode() mac = hmac.new(key, msg=request.data, digestmod=sha1) - if not compare_digest(mac.hexdigest(), signature): + if not compare_digest(mac.hexdigest(), str(signature)): abort(403) if repo.get('action', None):