title: TypeError: expected a character buffer object
body: <p>I have the following code:</p>
  
  <pre><code>import os
  import csv
  
  
  listing = os.listdir('/directory/my/files/are/in')
  os.chdir('/directory/my/files/are/in')
  
  for file in listing[1:]:
      r = csv.reader(open(file, 'rU')) 
  
      for row in r:
          stuff = [str.split('\t', 1) for row in r]
          print stuff
  </code></pre>
  
  <p>which returns <code>TypeError: expected a character buffer object</code>. How do I fix this? Basically I want to open all (csv) files in a directory and then cut out certain junk from each cell (everything after and including /t.) </p>