title: Why is the Python CSV reader ignoring double-quoted fields?
body: <p>I think this is probably something simple, but after an hour of searching, I've had no luck figuring out what I'm doing wrong.</p>
  
  <p>I'm using the following code to read a CSV file - I have no problem reading the file, but when a line contains a field that is double-quoted because it contains the delimiter, the CSV reader ignores the double-quotes and parses the field into 2 separate fields.</p>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>myReader = csv.reader(open(inPath, 'r'), dialect='excel', delimiter=',', quotechar='"')
  for row in myReader:
      print row,
      print len(row)
  </code></pre>
  
  <p>My input:</p>
  
  <pre><code>hello, this is row 1, foo1
  hello, this is row 2, foo2
  goodbye, "this, is row 3", foo3
  </code></pre>
  
  <p>Which gives me:</p>
  
  <pre><code>['hello', ' this is row 1', ' foo1'] 3
  ['hello', ' this is row 2', ' foo2'] 3
  ['goodbye', ' "this', ' is row 3"', ' foo3'] 4
  </code></pre>
  
  <p>What do I need to change so it will recognize the double-quoted field as one field?
  I'm using python version 2.6.1.</p>
  
  <p>Thanks!</p>