title: CSV NamedTemporaryFile not saving properly
body: <p>I'm trying to make a csv file using Python's csv and tempfile tools. I've been declaring it as follows:</p>
  
  <pre><code>csvattachment = tempfile.NamedTemporaryFile(suffix='.csv', prefix=('student_' + studentID), delete=False)
  with open(csvattachment.name, 'w+') as csvfile:
      filewriter = csv.writer(csvfile, delimiter=',')
      filewriter.writerow([ #WRITE CONTENT HERE])
  </code></pre>
  
  <p>What I am then doing after is attaching this file and sending it out. The problem with that is that instead of being called 'student_1736823.csv' the attachment name is something uglier like <code>&lt;tempfile._TemporaryFileWrapper object at 0x10cbf5e48&gt;</code></p>