title: Do files get closed during an exception exit?
body: <p>Do open files (and other resources) get automatically closed when the script exits due to an exception?</p>
  
  <p>I'm wondering if I need to be closing my resources during my exception handling.</p>
  
  <p><strong>EDIT</strong>: to be more specific, I am creating a simple log file in my script. I want to know if I need to be concerned about closing the log file explicitly in the case of exceptions.
  since my script has a complex, nested, try/except blocks, doing so is somewhat complicated, so if python, CLIB, or the OS is going to close my text file when the script crashes/errors out, I don't want to waste too much time on making sure the file gets closed.</p>
  
  <p>If there is a part in Python manual that talks about this, please refer me to it, but I could not find it.</p>