[Lldb-commits] [PATCH] D76955: [lldb/Test] Decode stdout and stderr in case it contains UTF-8

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 21 09:10:36 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2de52422acf0: [lldb/Test] Decode stdout and stderr in case it contains Unicode. (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76955/new/

https://reviews.llvm.org/D76955

Files:
  lldb/test/API/lldbtest.py


Index: lldb/test/API/lldbtest.py
===================================================================
--- lldb/test/API/lldbtest.py
+++ lldb/test/API/lldbtest.py
@@ -110,6 +110,11 @@
             timeoutInfo = 'Reached timeout of {} seconds'.format(
                 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')
+
         output = """Script:\n--\n%s\n--\nExit Code: %d\n""" % (
             ' '.join(cmd), exitCode)
         if timeoutInfo is not None:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76955.259022.patch
Type: text/x-patch
Size: 637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200421/51f9ac4e/attachment.bin>


More information about the lldb-commits mailing list