This revision was automatically updated to reflect the committed changes.
Closed by commit rL286909: Fix TestMiniDumpNew.py test for Python 2/3 issue 
(authored by amccarth).

Changed prior to commit:
  https://reviews.llvm.org/D26643?vs=77900&id=77907#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26643

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py


Index: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
===================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -108,15 +108,16 @@
         /proc/PID/status which is written in the file
         """
         shutil.copyfile(core, newcore)
-        with open(newcore, "r+") as f:
+        with open(newcore, "rb+") as f:
             f.seek(offset)
-            self.assertEqual(f.read(5), oldpid)
+            currentpid = f.read(5).decode('utf-8')
+            self.assertEqual(currentpid, oldpid)
 
             f.seek(offset)
             if len(newpid) < len(oldpid):
                 newpid += " " * (len(oldpid) - len(newpid))
             newpid += "\n"
-            f.write(newpid)
+            f.write(newpid.encode('utf-8'))
 
     def test_deeper_stack_in_minidump_with_same_pid_running(self):
         """Test that we read the information from the core correctly even if we


Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -108,15 +108,16 @@
         /proc/PID/status which is written in the file
         """
         shutil.copyfile(core, newcore)
-        with open(newcore, "r+") as f:
+        with open(newcore, "rb+") as f:
             f.seek(offset)
-            self.assertEqual(f.read(5), oldpid)
+            currentpid = f.read(5).decode('utf-8')
+            self.assertEqual(currentpid, oldpid)
 
             f.seek(offset)
             if len(newpid) < len(oldpid):
                 newpid += " " * (len(oldpid) - len(newpid))
             newpid += "\n"
-            f.write(newpid)
+            f.write(newpid.encode('utf-8'))
 
     def test_deeper_stack_in_minidump_with_same_pid_running(self):
         """Test that we read the information from the core correctly even if we
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to