title: Why does this code raise csv.Error?
body: <p>I'm trying to write out CSV using Python's built-in <a href="https://docs.python.org/2/library/csv.html" rel="noreferrer">csv</a> module.</p>
  
  <pre><code>import csv
  import sys
  writer = csv.writer(sys.stdout, delimiter="|", quoting=csv.QUOTE_NONE)
  writer.writerow(['"foo', "bar"])
  </code></pre>
  
  <p>The output I expect is:</p>
  
  <pre><code>"foo|bar
  </code></pre>
  
  <p>However, I get this:</p>
  
  <pre><code>Error: need to escape, but no escapechar set
  </code></pre>
  
  <p>The <a href="https://docs.python.org/2/library/csv.html#csv.QUOTE_NONE" rel="noreferrer">documentation</a> says:</p>
  
  <blockquote>
    <p>When the current delimiter occurs in output data it is preceded by the current escapechar character. If escapechar is not set, the writer will raise Error if any characters that require escaping are encountered.</p>
  </blockquote>
  
  <p>Now, the delimiter ('|', the pipe character) doesn't appear anywhere in the data. Why is the CSV writer trying to escape something?</p>