title: Removing last row in csv
body: <p>I'm trying to remove the last row in a csv but I getting an error: <code>_csv.Error: string with NUL byte</code></p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>dcsv = open('PnL.csv' , 'a+r+b')
  cWriter = csv.writer(dcsv, delimiter=' ')
  cReader = csv.reader(dcsv)
  for row in cReader:
      cWriter.writerow(row[:-1])
  </code></pre>
  
  <p>I cant figure out why I keep getting errors</p>