publisher: only handle non-encodable exception strings in python 2 (#36515)
This commit is contained in:
parent
4b9c230141
commit
7b0978cf00
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue