title: How to create a new CSV file and then store it in Google Cloud Storage?
body: <p>I have this code:</p>
  
  <pre><code>import csv
  from google.cloud import storage
  import os
  
  os.environ["Credientials"]
  storage_client = storage.Client()
  
  mylist = ['Row1','Row2','Row3']  # Rows I'm making for CSV file
  
  with open('Afile.csv', 'w') as myfile:
     wr = csv.writer(myfile, quoting=csv.QUOTE_ALL)  # Making CSV file
     wr.writerow(mylist)
  
  s = myfile
  
  def upload_blob(bucket_name, source_file_name, destination_blob_name):
     """Uploads a file to the bucket."""
     storage_client = storage.Client()
     bucket = storage_client.get_bucket(bucket_name)
     blob = bucket.blob(destination_blob_name)
     blob.upload_from_filename(source_file_name)
     print('File {} uploaded to {}.'.format(
       source_file_name,
       destination_blob_name))
  
  upload_blob('BucketName', s ,'storage location') # Uploading the newly made CSV file to Google Cloud Storage
  </code></pre>
  
  <p>Where a new CSV file is made ( referred to by <code>s</code>) and I am trying to upload that newly made file to Google Cloud storage, instead of uploading it from a local file path. When I run this, I get the following error:</p>
  
  <pre><code>TypeError: expected string or bytes-like object
  </code></pre>
  
  <p>How could I get this working so I can make a newly made CSV file and then upload it to Google Cloud Storage? If this is possible?</p>
  
  <p>Thanks for the help!</p>