From 7b0978cf0058e4d3bb23f38d3258fe0040008d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 19 Nov 2019 14:20:08 +0100 Subject: [PATCH] publisher: only handle non-encodable exception strings in python 2 (#36515) --- wcs/qommon/publisher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcs/qommon/publisher.py b/wcs/qommon/publisher.py index 7bca109ff..dfa437f6d 100644 --- a/wcs/qommon/publisher.py +++ b/wcs/qommon/publisher.py @@ -183,7 +183,8 @@ class QommonPublisher(Publisher, object): def _generate_plaintext_error(self, request, original_response, exc_type, exc_value, tb, limit = None): - if exc_value: + if exc_value and six.PY2: + # do not fail on exception strings using non-ascii chars exc_value = force_text(str(exc_value), errors='ignore').encode('ascii') if not self.USE_LONG_TRACES: if not request: