title: How to download .gz files with requests in Python without decoding it?
body: <p>I am downloading a file using <code>requests</code>:</p>
  
  <pre><code>import requests
  
  req = requests.get(url, stream=True)
  with open(local_filename, 'wb') as f:
      for chunk in req.iter_content(chunk_size=1024):
          if chunk:
              f.write(chunk)
              f.flush()
  </code></pre>
  
  <p>The problem with gzip files is that they being automatically decoded by requests, hence i get the unpacked file on disk, while i need the original file.</p>
  
  <p>Is there a way to tell requests not to do this?</p>