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
 


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to