title: python logging does not release file
body: <p>I have been using logging and notice that after first compile, the output file for logging hangs, and I cannot remove it till I close IDLE.</p>
  
  <p>I believe that I should "close" logging before the compilation finish, but don't know how to do that with the way that I am using logging:</p>
  
  <pre><code>LOGFILE = os.path.join(backup_folder,'test.log')
  logging.basicConfig(filename=LOGFILE,level=logging.DEBUG,format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
  logging.debug('test')
  </code></pre>