diff options
| author | Zachary Turner <zturner@google.com> | 2016-01-26 00:59:42 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-01-26 00:59:42 +0000 |
| commit | 00b87282cd645564ee40bc56616925cb4318dc03 (patch) | |
| tree | 8d538f6c0d20cbf95074328c508dd0bbb6be9191 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
| parent | c35b91cee23079e32f421dbea5e2697ae492ef6b (diff) | |
| download | bcm5719-llvm-00b87282cd645564ee40bc56616925cb4318dc03.tar.gz bcm5719-llvm-00b87282cd645564ee40bc56616925cb4318dc03.zip | |
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.
llvm-svn: 258759
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
| -rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 015615bd875..cea085c50a0 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -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 |

