diff options
Diffstat (limited to 'django/utils/encoding.py')
| -rw-r--r-- | django/utils/encoding.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 65bc1ad728..a050586cba 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -66,16 +66,7 @@ def force_text(s, encoding='utf-8', strings_only=False, errors='strict'): else: s = str(s) except UnicodeDecodeError as e: - if not isinstance(s, Exception): - raise DjangoUnicodeDecodeError(s, *e.args) - else: - # If we get to here, the caller has passed in an Exception - # subclass populated with non-ASCII bytestring data without a - # working __str__() method. Try to handle this without raising a - # further exception by individually forcing the exception args - # to strings. - s = ' '.join(force_text(arg, encoding, strings_only, errors) - for arg in s) + raise DjangoUnicodeDecodeError(s, *e.args) return s |
