From: Daniel Axtens Date: Sat, 3 Sep 2016 07:07:19 +0000 (+1000) Subject: xmlrpc authentication: Fix base64 decoding for py3 X-Git-Tag: v2.0.0-rc1~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b7eedcb7b99f44f6ce73ef9ec5ff24d52e40783;p=thirdparty%2Fpatchwork.git 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 --- 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')