[Lldb-commits] [lldb] r258759 - Write the session log file in UTF-8.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 25 16:59:42 PST 2016


Author: zturner
Date: Mon Jan 25 18:59:42 2016
New Revision: 258759

URL: http://llvm.org/viewvc/llvm-project?rev=258759&view=rev
Log:
Write the session log file in UTF-8.

Previously we were writing in the default encoding, which depends
on the operating system and is not guaranteed to be unicode aware.
On Python 3, this would lead to a situation where writing unicode
text to the log file generates an exception.  The fix here is to
write session logs using the proper encoding, which incidentally
fixes another test, so xfail is removed from that.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py?rev=258759&r1=258758&r2=258759&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py Mon Jan 25 18:59:42 2016
@@ -25,7 +25,6 @@ class Char1632TestCase(TestBase):
                        line_number(self.source, '// breakpoint2') ]
 
     @expectedFailureIcc # ICC (13.1) does not emit the DW_TAG_base_type for char16_t and char32_t.
-    @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
     def test(self):
         """Test that the C++11 support for char16_t and char32_t works correctly."""
         self.build()

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=258759&r1=258758&r2=258759&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jan 25 18:59:42 2016
@@ -1436,7 +1436,7 @@ class Base(unittest2.TestCase):
 
         session_file = "{}.log".format(self.log_basename)
         # Python 3 doesn't support unbuffered I/O in text mode.  Open buffered.
-        self.session = open(session_file, "w")
+        self.session = io.open(session_file, "w", encoding="utf-8")
 
         # Optimistically set __errored__, __failed__, __expected__ to False
         # initially.  If the test errored/failed, the session info




More information about the lldb-commits mailing list