title: Joining byte list with python
body: <p>I'm trying to develop a tool that read a binary file, makes some changes and save it. What I'm trying to do is make a list of each line in the file, work with several lines and then join the list again.</p>
  
  <p>This is what I tried:</p>
  
  <pre><code>file = open('myFile.exe', 'r+b')
  
  aList = []
  for line in f:
      aList.append(line)
  
  #Here im going to mutate some lines.
  
  new_file = ''.join(aList)
  </code></pre>
  
  <p>and give me this error:</p>
  
  <pre><code>TypeError: sequence item 0: expected str instance, bytes found
  </code></pre>
  
  <p>which makes sense because I'm working with bytes.</p>
  
  <p>Is there a way I can use join function o something similar to join bytes?
  Thank you.</p>