title: python: need to close file from mkstemp if I use fdopen?
body: <p>Which of the following is more correct?</p>
  
  <pre><code>fi, path = tempfile.mkstemp()
  f = os.fdopen(fi, "w")
  f.write(res)
  f.close()
  os.close(fi)
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>fi, path = tempfile.mkstemp()
  f = os.fdopen(fi, "w")
  f.write(res)
  f.close()
  </code></pre>