title: csv file convert to io.BytesIO object, then stream to blob storage ,meets value type error:a bytes-like object is required, not '_io.TextIOWrapper'
body: <p>I am trying to stream a csv  to azure blob storage, the csv is generated directly from python scripts without local copy, i have the following code, df is the csv file:</p>
  
  <pre><code>    with open(df,'w') as f:
         stream = io.BytesIO(f)
         stream.seek(0)
         block_blob_service.create_blob_from_stream('flowshop', 'testdata123', stream)
  </code></pre>
  
  <p>then i got the error massage:</p>
  
  <pre><code>  stream = io.BytesIO(f)  TypeError: a bytes-like object is required, not '_io.TextIOWrapper'
  </code></pre>
  
  <p>i think the problem has been the format incorrect, can you please identify the problem. thanks. </p>