diff options
author | Pavel Labath <pavel@labath.sk> | 2018-09-01 12:15:46 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2018-09-01 12:15:46 +0000 |
commit | 89d2245a2ac5d6690166d0752da49d011fff9a7d (patch) | |
tree | 09c22d164aab30e58b4b26fdd9b06e645f4fde69 /lldb/packages/Python/lldbsuite/support/encoded_file.py | |
parent | 399943bc76bf9768728f79e289468fc2ba5652e9 (diff) | |
download | bcm5719-llvm-89d2245a2ac5d6690166d0752da49d011fff9a7d.tar.gz bcm5719-llvm-89d2245a2ac5d6690166d0752da49d011fff9a7d.zip |
Ignore unicode decode errors in test suite's encoded_file class
These happen in a couple of tests when lldb tries to pretty print a
const char * variable in the inferior which points to garbage. Instead,
we have the python replace the invalid sequences with the unicode
replacement character.
llvm-svn: 341274
Diffstat (limited to 'lldb/packages/Python/lldbsuite/support/encoded_file.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/support/encoded_file.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/support/encoded_file.py b/lldb/packages/Python/lldbsuite/support/encoded_file.py index 2c2fef383f7..5c04cce3b3f 100644 --- a/lldb/packages/Python/lldbsuite/support/encoded_file.py +++ b/lldb/packages/Python/lldbsuite/support/encoded_file.py @@ -31,7 +31,7 @@ def _encoded_write(old_write, encoding): # If we were asked to write a `str` (in Py2) or a `bytes` (in Py3) decode it # as unicode before attempting to write. if isinstance(s, six.binary_type): - s = s.decode(encoding) + s = s.decode(encoding, "replace") return old_write(s) return impl |