[Lldb-commits] [PATCH] D16680: Re-submit rL258759: Write the session log file in UTF-8.

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 28 03:50:40 PST 2016


tberghammer created this revision.
tberghammer added reviewers: zturner, tfiala.
tberghammer added a subscriber: lldb-commits.

Re-submit rL258759: 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.

http://reviews.llvm.org/D16680

Files:
  packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
  packages/Python/lldbsuite/test/lldbtest.py

Index: packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -262,7 +262,7 @@
         if self.trace:
             print(self.getvalue(), file=sys.stderr)
         if self.session:
-            print(self.getvalue(), file=self.session)
+            print(self.getvalue().decode('utf8', errors='replace').encode(errors='replace'), file=self.session)
         self.close()
 
 @add_metaclass(abc.ABCMeta)
@@ -1843,7 +1843,7 @@
         if not self.__unexpected__ and not self.__skipped__:
             for test, traceback in pairs:
                 if test is self:
-                    print(traceback, file=self.session)
+                    print(traceback.decode('utf8', errors='replace').encode(errors='replace'), file=self.session)
 
         # put footer (timestamp/rerun instructions) into session
         testMethod = getattr(self, self._testMethodName)
Index: packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
===================================================================
--- packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
+++ packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
@@ -25,7 +25,6 @@
                        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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16680.46256.patch
Type: text/x-patch
Size: 1715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160128/ece26d49/attachment.bin>


More information about the lldb-commits mailing list