From 0e8a2e00a181cf28ffe90e5975532341ef3f874b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 20 May 2016 14:08:05 +0200 Subject: [PATCH] misc: make sure no unicode is emitted in traces (#11005) --- wcs/qommon/publisher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcs/qommon/publisher.py b/wcs/qommon/publisher.py index 52a6940..1fedd06 100644 --- a/wcs/qommon/publisher.py +++ b/wcs/qommon/publisher.py @@ -164,7 +164,7 @@ class QommonPublisher(Publisher): def _generate_plaintext_error(self, request, original_response, exc_type, exc_value, tb, limit = None): if exc_value: - exc_value = unicode(str(exc_value), errors='ignore') + exc_value = unicode(str(exc_value), errors='ignore').encode('ascii') if not self.USE_LONG_TRACES: if not request: # this happens when an exception is raised by an afterjob @@ -305,7 +305,7 @@ class QommonPublisher(Publisher): error_summary = traceback.format_exception_only(exc_type, exc_value) error_summary = error_summary[0][0:-1] # de-listify and strip newline - error_summary = unicode(str(error_summary), errors='ignore') + error_summary = unicode(str(error_summary), errors='ignore').encode('ascii') plain_error_msg = self._generate_plaintext_error(request, original_response, -- 2.8.1