title: How do I change the line endings used by PExpect output
body: <p>The returned output from pexpect.run() includes \r\n at the end of every line.  Printing to the terminal using print(returnVal.decode()) correctly prints one line for each line returned.  When I examine the output I see that the byte string contains \r\n.  When I log that to a file I get double returns to the log file.  I'm on a Mac using Python 3.7.  Is there a way to set the preferred new line when writing the output?  I am using pythons logging class and using the info() method to write the string.  Output looks like this:</p>
  
  <pre><code>total 80
  -rw-r--r--   1 xxxx  admin  1048 Nov 12 00:41 Constants.py
  
  -rw-r--r--   1 xxxx  admin  5830 Nov 12 13:33 file1.py
  
  -rw-r--r--   1 xxxx  admin  2255 Nov 12 00:51 file2.py
  </code></pre>
  
  <p>When it should look like:</p>
  
  <pre><code>total 80
  -rw-r--r--   1 xxxx  admin  1048 Nov 12 00:41 Constants.py
  -rw-r--r--   1 xxxx  admin  5830 Nov 12 13:33 file1.py
  -rw-r--r--   1 xxxx  admin  2255 Nov 12 00:51 file2.py
  </code></pre>
  
  <p>Here is a simplified version of my original Logger class:</p>
  
  <pre><code>class Logger():
      def __init__( self, path ):
          msgFormat   = '%(asctime)s.%(msecs)d\t%(message)s'
          dateFormat  = '%m/%d/%Y %H:%M:%S'
          logging.basicConfig( format=msgFormat, datefmt=dateFormat, filename=path, level=logging.INFO )
  
      def Log ( self, theStr ):
          logging.info( str( theStr ))
  </code></pre>
  
  <p>The string being returned from Pexpect looks something like:</p>
  
  <pre><code>Line1\r\nLine2
  </code></pre>