title: reading gzipped csv file in python 3
body: <p>I'm having problems reading from a gzipped csv file with the <code>gzip</code> and <code>csv</code> libs. Here's what I got:</p>
  
  <pre><code>import gzip
  import csv
  import json
  
  f = gzip.open(filename)
  csvobj = csv.reader(f,delimiter = ',',quotechar="'")
  for line in csvobj:
              ts = line[0]
              data_json = json.loads(line[1])
  </code></pre>
  
  <p>but this throws an exception:</p>
  
  <pre><code> File "C:\Users\yaronol\workspace\raw_data_from_s3\s3_data_parser.py", line 64, in download_from_S3
      self.parse_dump_file(filename)
    File "C:\Users\yaronol\workspace\raw_data_from_s3\s3_data_parser.py", line 30, in parse_dump_file
      for line in csvobj:
  _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
  </code></pre>
  
  <p>gunzipping the file and opening that with csv works fine. I've also tried decoding the file text to convert from bytes to str...</p>
  
  <p>What am I missing here?</p>