Index: packages/Python/lldbsuite/support/encoded_file.py =================================================================== --- packages/Python/lldbsuite/support/encoded_file.py +++ packages/Python/lldbsuite/support/encoded_file.py @@ -31,7 +31,9 @@ # 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) + # When decoding the string, replace invalid characters with (U+FFFD, 'REPLACEMENT CHARACTER'). + # This may result in data loss + s = s.decode(encoding, 'replace') return old_write(s) return impl