Why isn't IDLE creating a new log file with logging module when being run again?
<p>I was testing out some simple logging examples for Python's logging module in IDLE:</p>

<pre><code>import logging

logging.basicConfig(level=logging.DEBUG,
    format='%(asctime)s %(levelname)s %(message)s', filename='TESTLOG.log')

logging.debug('A debug message')
</code></pre>

<p>And it works as expected: A file called TESTLOG.log is created with the debug message. </p>

<p>But if I delete the log file while the IDLE script window is open, when I try to run the module again / f5, a new log file is not created. If I close the script window and then re-open and run it, the log file is created.  </p>

<p>Conversely, if I run the script from the command line, the log file is always generated after I delete the log file and rerun the script.</p>

<p>What's the difference between the two situations?</p>
