title: How to deal with deflated response by urllib2?
body: <p>I currently use following code to decompress gzipped response by urllib2:</p>
  
  <pre><code>opener = urllib2.build_opener()
  response = opener.open(req)
  data = response.read()
  if response.headers.get('content-encoding', '') == 'gzip':
      data = StringIO.StringIO(data)
      gzipper = gzip.GzipFile(fileobj=data)
      html = gzipper.read()
  </code></pre>
  
  <p>Does it handle deflated response too or do I need to write seperate code to handle deflated response?</p>