Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lldb/test/API/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,14 @@ def execute(self, test, litConfig):
litConfig.maxIndividualTestTime)

if sys.version_info.major == 2:
# In Python 2, string objects can contain Unicode characters.
out = out.decode('utf-8')
err = err.decode('utf-8')
# In Python 2, string objects can contain Unicode characters. Use
# the non-strict 'replace' decoding mode. We cannot use the strict
# mode right now because lldb's StringPrinter facility and the
# Python utf8 decoder have different interpretations of which
# characters are "printable". This leads to Python utf8 decoding
# exceptions even though lldb is behaving as expected.
out = out.decode('utf-8', 'replace')
err = err.decode('utf-8', 'replace')

output = """Script:\n--\n%s\n--\nExit Code: %d\n""" % (
' '.join(cmd), exitCode)
Expand Down