title: Converting output from subprocess to csv.reader object
body: <p>Is there a way to take the output from subprocess and turn it into an iterable csv.reader or csv.DictReader object? Here's the code I've been trying:</p>
  
  <pre><code>p2 = subprocess.Popen("sort command...", stdout=subprocess.PIPE)
  output = p2.communicate()[0]
  edits = csv.reader(output, delimiter="\t")
  </code></pre>
  
  <p>Basically, I'm sorting a large CSV file, and then I'd like to get it into Python as a csv.reader object.</p>
  
  <p>The error I'm getting is </p>
  
  <blockquote>
    <p>Error: iterator should return strings, not int (did you open the file in text mode?)</p>
  </blockquote>
  
  <p>Is there a way to treat this bytestream as a csv.reader object, or am I thinking about things the wrong way?</p>