PythonWin debugger holds onto global logging objects too long

Vinay Sajip vinay_sajip at
Sat Feb 4 12:09:32 EST 2012

On Jan 24, 2:52 pm, Rob Richardson <RDRichard... at> wrote:
> I use PythonWin to debug the Python scripts we write.  Our scripts often use the log2pyloggingpackage.  When running the scripts inside the debugger, we seem to get oneloggingobject for every time we run the script.  The result is that after running the script five times, the log file contains five copies of every message.  The only way I know to clean this up and get only a single copy of each message is to close PythonWin and restart it.
> What do I have to do in my scripts to clean up theloggingobjects so that I never get more than one copy of each message in my log files?

I don't know what log2py is - Google didn't show up anything that
looked relevant. If you're talking about the logging package in the
Python standard library, I may be able to help: but a simple script
that I ran in PythonWin didn't show any problems, so you'll probably
need to post a short script which demonstrates the problem when run in


Vinay Sajip

More information about the Python-list mailing list