title: Downloading File Code changes file content and affects ability to decrypt file
body: <p>When I download a file from my server using Python and urlib2, the files contents are slightly different than what they should be.</p>
  
  <p>They are different in that there are extra lines("\r\n" or "\n") added to the downloaded version of the file. This isn't a major problem for a file that is in xml form but its a major problem when my file is encrypted because the file contents are slightly different and they cant be decrypted.</p>
  
  <p>I know its my download code thats altering the file contents and not the file thats on the server being wrong because I have downloaded that file using FTP and found it has the correct content when I download it that way. Some more useful information: the file is ASCII encoded. My server is Windows .NET and I'm unsure if the http response is ascii or unicode - maybe that could be causing the problem?</p>
  
  <p>How can I make urlib2 download my file from my server and ensure that the content doesn't change?</p>
  
  <p>Original content:</p>
  
  <pre><code>     &lt;clientlist&gt;
  
  
         &lt;client&gt;
           &lt;clientauthblah&gt;blah&lt;/clientauthblah&gt;
           &lt;version9&gt;blah&lt;/version9&gt;
           &lt;version10&gt;blah&lt;/version10&gt;
           &lt;companyno&gt;1&lt;/companyno&gt;
           &lt;companyname&gt;blah&lt;/companyname&gt;
         &lt;/client&gt;
  </code></pre>
  
  <p>When I run my download code this is the content I get, this is something I cant have because my files are encrypted and it means I cant decrypt the file:</p>
  
  <pre><code> &lt;clientlist&gt;
  
  
  
  
     &lt;client&gt;
  
       &lt;clientauthblah&gt;blah&lt;/clientauthblah&gt;
  
       &lt;version9&gt;blah&lt;/version9&gt;
  
       &lt;version10&gt;blah&lt;/version10&gt;
  
       &lt;companyno&gt;1&lt;/companyno&gt;
  
       &lt;companyname&gt;blah&lt;/companyname&gt;
  
     &lt;/client&gt;
  </code></pre>
  
  <p>Heres my code:</p>
  
  <pre><code># Download
  response = urllib2.urlopen("http://www.mywebsite.com/Clients.xml")
  output    = open("tempEncrypted.xml",'w')
  res       = response.read()
  output.write(res)
  output.close()
  </code></pre>