title: Duplication of specific file format
body: <p>I have a file format which looks like the following in Notepad ++ if downloaded by a GUI:</p>
  
  <pre><code>LF
  headerline CR LF
  dataline CR LF
  ...
  last dataline LF
  LF
  headerline CR LF
  ....
  </code></pre>
  
  <p>and so on </p>
  
  <p>If I run for instance with it through a python script for automatic backup by:</p>
  
  <pre><code>output, error = process.communicate()
  out = output.splitlines()
  with open('test13.txt', 'w') as file:
      for line in out: 
          if line == '\n':
              file.write('\n')
          else: 
              file.write(line)
              file.write ('\n') 
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>headerline CR LF
  dataline CR LF
  dataline CR LF
  ....
  </code></pre>
  
  <p>How to handle this? It seems like an encoding problem?</p>
  
  <p>If I run with:</p>
  
  <pre><code>with io.open('test13.txt', 'wb') as file:
      file.write(output)
  </code></pre>
  
  <p>I get a similar result.  </p>
  
  <p>Thanks!</p>