From 3617f86e9d899021281c98295e50a7399dc18f80 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 5 Apr 2020 16:43:11 +0200 Subject: [PATCH] morss: make cgi_encore more robust --- morss/morss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morss/morss.py b/morss/morss.py index d24ab24..473201a 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -720,7 +720,7 @@ def cgi_error_handler(environ, start_response, app): @middleware def cgi_encode(environ, start_response, app): out = app(environ, start_response) - return [x if isinstance(x, bytes) else x.encode('utf-8') for x in out] + return [x if isinstance(x, bytes) else str(x).encode('utf-8') for x in out] def cli_app():