From c9c52308eb82c9beeed55827121a289539a1234a Mon Sep 17 00:00:00 2001 From: Sander Verkuil Date: Wed, 5 Dec 2018 20:54:32 +0100 Subject: [PATCH] Force the padded string to be string The padded string was an unicode string which is not allowed in the base64.urlsafe_b64decode function. See https://stackoverflow.com/questions/20849805/python-hmac-typeerror-character-mapping-must-return-integer-none-or-unicode/20862445 for reference. --- sentry_auth_google/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_auth_google/utils.py b/sentry_auth_google/utils.py index 73740b3..a70b38c 100644 --- a/sentry_auth_google/utils.py +++ b/sentry_auth_google/utils.py @@ -5,4 +5,4 @@ def urlsafe_b64decode(b64string): padded = b64string + b'=' * (4 - len(b64string) % 4) - return base64.urlsafe_b64decode(padded) + return base64.urlsafe_b64decode(str(padded))