From 8b7eedcb7b99f44f6ce73ef9ec5ff24d52e40783 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Sat, 3 Sep 2016 17:07:19 +1000 Subject: [PATCH] xmlrpc authentication: Fix base64 decoding for py3 The byte/string distinction in Python 3 requires this messy set of encode/decode to work. Signed-off-by: Daniel Axtens Reviewed-by: Stephen Finucane --- patchwork/views/xmlrpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/views/xmlrpc.py b/patchwork/views/xmlrpc.py index 65471e7f..edb75550 100644 --- a/patchwork/views/xmlrpc.py +++ b/patchwork/views/xmlrpc.py @@ -87,7 +87,7 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher, header = header[len('Basic '):].strip() try: - decoded = base64.decodestring(header) + decoded = base64.b64decode(header.encode('ascii')).decode('ascii') username, password = decoded.split(':', 1) except: raise Exception('Invalid authentication credentials') -- 2.47.3