title: Missing new line when downloading a text file using python's request package
body: <p>I am using the following code for downloading a csv file from a remote http server:</p>
  
  <pre><code>with contextlib.closing(requests.get("http://some_url/file.csv", stream= True)) as response, open('/tmp/archivo.csv', 'wb') as output_file:               
          for chunk in response.iter_lines(chunk_size=1024*8):
              if chunk:       
                  print(chunk)
                  output_file.write(chunk)
  </code></pre>
  
  <p>Everything seems to work, the output on the screen is:</p>
  
  <pre><code>b'Code,Description'
  b'"1","Some"'
  b'"2","Few"'
  b'"3","human"'
  ....
  </code></pre>
  
  <p>But the file is:</p>
  
  <pre><code>$ cat /tmp/archivo.csv                                                                                                                          
  Code,Description"1","Some""2","Few""3","human"...
  </code></pre>
  
  <p>I think that the issue is related to the new line encoding between Windows, GNU/Linux and Mac, but I don't know how to specify that in the code just showed.</p>
  
  <p>The problem is not related to opening the file in 'wb' mode, is I made the changes needed</p>
  
  <pre><code>with contextlib.closing(requests.get("http://some_url/file.csv", stream= True)) as response, open('/tmp/archivo.csv', 'w') as output_file:               
          for chunk in response.iter_lines(chunk_size=1024*8):
              if chunk:       
                  print(chunk.decode('utf-8'))
                  output_file.write(chunk.decode('utf-8'))
  </code></pre>
  
  <p>The output on the screen changes,</p>
  
  <pre><code>'Code,Description'
  '"1","Some"'
  '"2","Few"'
  '"3","human"'
  ...
  </code></pre>
  
  <p>but the file doesn't</p>
  
  <p>Any ideas?</p>