[Lldb-commits] [lldb] r341274 - Ignore unicode decode errors in test suite's encoded_file class

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Sat Sep 1 05:15:46 PDT 2018


Author: labath
Date: Sat Sep  1 05:15:46 2018
New Revision: 341274

URL: http://llvm.org/viewvc/llvm-project?rev=341274&view=rev
Log:
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.

Modified:
    lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py

Modified: lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py?rev=341274&r1=341273&r2=341274&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py Sat Sep  1 05:15:46 2018
@@ -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
 




More information about the lldb-commits mailing list