diff -ur python-ptrace.orig/ptrace/debugger/breakpoint.py python-ptrace.patched/ptrace/debugger/breakpoint.py
--- python-ptrace.orig/ptrace/debugger/breakpoint.py	2008-09-05 01:07:55.000000000 +0200
+++ python-ptrace.patched/ptrace/debugger/breakpoint.py	2008-12-20 13:55:06.000000000 +0100
@@ -30,7 +30,7 @@
             new_bytes = word2bytes(0x0cc00000)
         else:
             # Replace instruction with "INT 3"
-            new_bytes = "\xCC" * size
+            new_bytes = b"\xCC" * size
         process.writeBytes(address, new_bytes)
         self._installed = True

diff -ur python-ptrace.orig/ptrace/debugger/process.py python-ptrace.patched/ptrace/debugger/process.py
--- python-ptrace.orig/ptrace/debugger/process.py	2008-12-20 13:52:36.000000000 +0100
+++ python-ptrace.patched/ptrace/debugger/process.py	2008-12-20 13:55:06.000000000 +0100
@@ -505,7 +505,7 @@
             size -= subsize
             address += CPU_WORD_SIZE
         else:
-            data = ''
+            data = b''

         while size:
             # Read word
@@ -633,9 +633,9 @@
         while True:
             done = False
             data = self.readBytes(address, chunk_length)
-            if '\0' in data:
+            if 0 in data:
                 done = True
-                data = data[:data.index('\0')]
+                data = data[:data.index(b'\0')]
             if max_size <= size+chunk_length:
                 data = data[:(max_size-size)]
                 string.append(data)
@@ -646,7 +646,7 @@
                 break
             size += chunk_length
             address += chunk_length
-        return ''.join(string), truncated
+        return b''.join(string), truncated

     def dumpStack(self, log=None):
         if not log:
diff -ur python-ptrace.orig/ptrace/pydistorm.py python-ptrace.patched/ptrace/pydistorm.py
--- python-ptrace.orig/ptrace/pydistorm.py	2008-12-20 13:52:25.000000000 +0100
+++ python-ptrace.patched/ptrace/pydistorm.py	2008-12-20 13:55:06.000000000 +0100
@@ -75,8 +75,8 @@
     # Check arguments
     if not isinstance(codeOffset, int):
         raise TypeError("codeOffset have to be an integer")
-    if not isinstance(code, str):
-        raise TypeError("code have to be a string")
+    if not isinstance(code, bytes):
+        raise TypeError("code have to be bytes")
     if dt not in DECODERS:
         raise IndexError("Decoding-type must be either Decode16Bits, Decode32Bits or Decode64Bits.")

diff -ur python-ptrace.orig/gdb.py python-ptrace.patched/gdb.py
--- python-ptrace.orig/gdb.py	2008-12-20 13:52:17.000000000 +0100
+++ python-ptrace.patched/gdb.py	2008-12-20 13:55:06.000000000 +0100
@@ -343,10 +343,10 @@
                 bytes = self.process.readBytes(address, size)

                 # Format bytes
-                hexa = ' '.join( "%02x" % ord(byte) for byte in bytes )
+                hexa = ' '.join( ("%02x" % byte) for byte in bytes )
                 def toAscii(byte):
-                    if 32 <= ord(byte) <= 127:
-                        return byte
+                    if 32 <= byte <= 127:
+                        return chr(byte)
                     else:
                         return '.'
                 ascii = ''.join(toAscii(byte) for byte in bytes)
