title: Converting xls to csv in Python 3 using xlrd
body: <p>I'm using Python 3.3 with xlrd and csv modules to convert an xls file to csv. This is my code:</p>
  
  <pre><code>import xlrd
  import csv
  
  def csv_from_excel():
  
      wb = xlrd.open_workbook('MySpreadsheet.xls')
      sh = wb.sheet_by_name('Sheet1')
      your_csv_file = open('test_output.csv', 'wb')
      wr = csv.writer(your_csv_file, quoting=csv.QUOTE_ALL)
  
      for rownum in range(sh.nrows):
  
          wr.writerow(sh.row_values(rownum))
  
      your_csv_file.close()
  </code></pre>
  
  <p>With that I am receiving this error: <code>TypeError: 'str' does not support the buffer interface</code></p>
  
  <p>I tried changing the encoding and replaced the line within the loop with this:</p>
  
  <pre><code>wr.writerow(bytes(sh.row_values(rownum),'UTF-8'))
  </code></pre>
  
  <p>But I get this error: <code>TypeError: encoding or errors without a string argument</code></p>
  
  <p>Anyone know what may be going wrong?</p>