# HG changeset patch # User Daniel Dourvaris # Date 2020-05-20 08:44:04 # Node ID 365337eba172d73f4984d13b662552b066761d8a # Parent baeed9e1e1bdd58db868a958adb9a72c8fcc31bf auth-crawd: py3 compat diff --git a/rhodecode/authentication/plugins/auth_crowd.py b/rhodecode/authentication/plugins/auth_crowd.py --- a/rhodecode/authentication/plugins/auth_crowd.py +++ b/rhodecode/authentication/plugins/auth_crowd.py @@ -153,25 +153,25 @@ class CrowdServer(object): global msg msg = "" try: - rdoc = self.opener.open(request) - msg = "".join(rdoc.readlines()) + ret_doc = self.opener.open(request) + msg = ret_doc.read() if not msg and empty_response_ok: - rval = {} - rval["status"] = True - rval["error"] = "Response body was empty" + ret_val = {} + ret_val["status"] = True + ret_val["error"] = "Response body was empty" elif not noformat: - rval = json.loads(msg) - rval["status"] = True + ret_val = json.loads(msg) + ret_val["status"] = True else: - rval = "".join(rdoc.readlines()) + ret_val = msg except Exception as e: if not noformat: - rval = {"status": False, - "body": body, - "error": str(e) + "\n" + msg} + ret_val = {"status": False, + "body": body, + "error": "{}\n{}".format(e, msg)} else: - rval = None - return rval + ret_val = None + return ret_val def user_auth(self, username, password): """Authenticate a user against crowd. Returns brief information about