title: Bytes(str?) to CSV
body: <p>I've looked at the posts <a href="https://stackoverflow.com/questions/37974199/writing-to-io-bytesio-in-csv-fails-in-python3">here</a> and <a href="https://stackoverflow.com/questions/3305926/python-csv-string-to-array">here</a>. But they have either been trying to write bytes to a CSV or saving a CSV from a string but I'm trying to connect trying writing bytes to a CSV.</p>
  
  <p>I have a blob of <code>bytes</code> and if I do <code>type(bytes)</code> I get <code>&lt;class 'bytes'&gt;</code> but when I try to write to a csv I get an error </p>
  
  <pre><code>(Pdb) f = open('/Users/minhmai/test.csv', 'wb+')
  (Pdb) writer = csv.writer(f)
  (Pdb) writer.writerow(bytes)
  *** TypeError: a bytes-like object is required, not 'str'
  
  
  (Pdb) f = open('/Users/minhmai/test.csv', 'wb+')
  (Pdb) writer = csv.writer(f)
  (Pdb) writer.writerows(bytes)
  *** _csv.Error: iterable expected, not int
  </code></pre>
  
  <p>However If I do this, I just get a number but it's not really saved to a CSV.</p>
  
  <pre><code>(Pdb) wfile = io.StringIO()
  (Pdb) writer = csv.writer(wfile)
  (Pdb) writer.writerow(bytes)
  </code></pre>
  
  <p>And example of what my data(<code>bytes</code>) look like is this</p>
  
  <pre><code>b'Date,ID,Amount\r\n2018-1-1,1,25\r\n2018-1-2,2,3\r\n2018-1-1,2,3\r\n`
  </code></pre>
  
  <p>Ideally this would result in a header row and 3 rows</p>