title: Getting "new-line character seen in unquoted field" error reading csv file
body: <p>I am trying to read a csv file into a program and I am getting the following four errors.</p>
  
  <pre class="lang-none prettyprint-override"><code>File "/Users/interpott/Downloads/SatStressGUI-master/Contents/Resources/satstressgui.py", line 2173, in load
  File "/Users/interpott/Downloads/SatStressGUI-master/Contents/Resources/satstressgui.py", line 891, in file_dialog
  File "/Users/interpott/Downloads/SatStressGUI-master/Contents/Resources/satstressgui.py", line 887, in file_dir_dialog
  File "/Users/interpott/Downloads/SatStressGUI-master/Contents/Resources/satstressgui.py", line 2203, in load_entries
  Error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode?
  </code></pre>
  
  <p>Code snippet:</p>
  
  <pre><code>def load(self, evt):
      try:
          file_dialog(self,
                      message=u"Load from CSV file",
                      style=wx.OPEN,
                      wildcard='CSV files (*.csv)|*.csv',
                      action=self.load_entries) **2173**
      except Exception, e:
          traceback.print_exc()
  
  def set_num_rows(self,num_rows):
      self.pp.SetRows(num_rows)
      self.sp.SetRows(num_rows)
      self.tp.SetRows(num_rows)
      if (num_rows &gt; self.rows):
          for j in range(num_rows-self.rows):
              self.add_row(self.fieldPanel,self.pp, self.header1, '0')
              self.add_row(self.fieldPanel,self.tp, self.header2, '')
              self.add_row(self.fieldPanel,self.sp, self.header3, '')
          self.update_parameters()
      else:
          for j in range(self.rows-num_rows):
              for p,d in self.header1+self.header2+self.header3:
                  self.parameters[p][-1].Destroy()
                  del self.parameters[p][-1]
                  del self.sc.parameters[p][-1]
      self.rows = num_rows
      self.row_ctrl.SetValue(num_rows)
      self.spin_value = num_rows
      self.sc.set_parameter('point_rows',self.rows)
      self.fieldPanel.Layout()
      self.fieldPanel.SetupScrolling()
  
  def load_entries(self, filename):
      f = open(filename)
      csvreader = csv.reader(f, dialect=csv.excel_tab)
      coord = csvreader.next() #Skip headers. **2203**
      data = list(csvreader)
      self.set_num_rows(len(data))
      try:
          keys = ['theta', 'phi', 't', 'orbit']
  
          for i,coord in enumerate(data):
  
              for key in keys:
                  val = coord[keys.index(key)]
                  self.parameters[key][i+1].SetValue(val)
                  self.sc.set_parameter(key, val, point = i+1)
      except:
          traceback.print_exc()
      finally:
          f.close()
          self.fieldPanel.Layout()
          self.fieldPanel.SetupScrolling()
          self.Layout()
  </code></pre>
  
  <p>I tried some of the common suggestions. Can anyone tell me where I am messing up?</p>
  
  <p>Sample CSV file below:</p>
  
  <pre class="lang-none prettyprint-override"><code>theta [degrees],phi [degrees],t [yrs],orbital pos [degrees],Stt [kPa],Spt [kPa],Spp [kPa],sigma1 [kPa],sigma3 [kPa],alpha [degrees]
  10,10,0,0,,,,,,
  10,10,1000,0,,,,,,
  10,10,2000,0,,,,,,
  10,10,3000,0,,,,,,
  10,10,4000,0,,,,,,
  10,10,5000,0,,,,,,
  10,10,6000,0,,,,,,
  10,10,7000,0,,,,,,
  10,10,8000,0,,,,,,
  10,10,9000,0,,,,,,
  10,10,10000,0,,,,,,
  10,10,11000,0,,,,,,
  10,10,12000,0,,,,,,
  10,10,13000,0,,,,,,
  10,10,14000,0,,,,,,
  10,10,15000,0,,,,,,
  10,10,16000,0,,,,,,
  10,10,17000,0,,,,,,
  10,10,18000,0,,,,,,
  10,10,19000,0,,,,,,
  10,10,20000,0,,,,,,
  10,10,21000,0,,,,,,
  10,10,22000,0,,,,,,
  10,10,23000,0,,,,,,
  10,10,24000,0,,,,,,
  10,10,25000,0,,,,,,
  </code></pre>