From 36bca799e10535a1dae210660cd75a6e8593f697 Mon Sep 17 00:00:00 2001 From: Unrud Date: Thu, 24 Aug 2017 14:34:29 +0200 Subject: [PATCH] Use length of encoded error response This is purely cosmetic. The lengths are the same, because it gets encoded as ASCII. --- radicale/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index abf466f..9b2fec7 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -327,10 +327,11 @@ class Application: self.logger.error("An exception occurred during %s request on %r: " "%s", method, path, e, exc_info=True) status, headers, answer = INTERNAL_SERVER_ERROR + answer = answer.encode("ascii") status = "%d %s" % ( status, client.responses.get(status, "Unknown")) headers = [("Content-Length", str(len(answer)))] + list(headers) - answers = [answer.encode("ascii")] + answers = [answer] start_response(status, headers) return answers