This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients
Date 2004-04-22.21:51:16
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

Windows is unique in that it will not allow renaming (or 
deleting) a file that's open.  I expect that by calling refresh() 
all the time, you're creating additional new objects that have 
C:\log.txt open, so that it's impossible for rollover to rename 
C:\log.txt on Windows.  There's nothing the logging package 
can do about that.

You're also adding an endless number of redundant handlers 
to the same logger.  Try this:

1.  In your __init__ method, set

     self.logger = None

2. Start your refresh() method with

        if self.logger is not None:
            self.rotatingFileLogHandler.close()
            self.logger.removeHandler(self.rotatingFileLogHandler)

Closing the old handler arranges to close the C:\log.txt file, so 
that it's *possible* to rename it on Windows.  Removing the 
old handler from the logger should prevent seeing an 
unpredictable number of copies of individual log msgs, and 
probably prevent some "I/O operation on closed file" screwups 
too.
History
Date User Action Args
2007-08-23 14:21:08adminlinkissue939836 messages
2007-08-23 14:21:08admincreate