title: python - creating an empty file and closing in one line
body: <p>I want to ensure that all resources are being cleaned correctly. Is this a safe thing to do:</p>
  
  <pre><code>try:
      closing(open(okFilePath, "w"))
  except Exception, exception:
      logger.error(exception)
      raise
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Infact, thinking about it, do I even need the try/catch as I am raising the exception anyways I can log at a higher level. If it errors on creating the file, one can assume there is nothing to close?</p>