title: TypeError: write() argument must be str, not byte , upgrade to python 3
body: <p>I am trying to upgrade my code to python 3. 
  Having some trouble with this line,</p>
  
  <p><code>output_file = open(working_dir + "E"+str(s)+".txt", "w+")</code></p>
  
  <pre><code>output_file.write(','.join(headers) + "\n")
  </code></pre>
  
  <p>and get this error <code>TypeError: sequence item 0: expected str instance, bytes found</code></p>
  
  <p><strong>What i've tried,</strong></p>
  
  <pre><code>  output_file.write(b",".join(headers) + b"\n")
  
  TypeError: write() argument must be str, not bytes
  </code></pre>
  
  <p>ive also tried using <code>decode()</code> on the join, also tried using <code>r</code> and <code>w+b</code> on open.</p>
  
  <p>How can i convert to <code>str</code> in python 3?</p>