[ python-Bugs-995109 ] logging.handlers.RotatingFileHandler missing error handling

SourceForge.net noreply at sourceforge.net
Wed Jul 21 11:40:57 CEST 2004


Bugs item #995109, was opened at 2004-07-21 12:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=995109&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Simon Dahlbacka (sdahlbac)
Assigned to: Nobody/Anonymous (nobody)
Summary: logging.handlers.RotatingFileHandler missing error handling

Initial Comment:
If i open('logfile','r') in one shell and in my program
use a RotatingFileHandler using the same 'logfile', then 

os.rename(self.baseFilename, dfn) # line 86 in handlers.py

will fail and no log open, thus subsequent logging
attempts will  trigger a ValueError and render the
application in an unusable state.
(File "C:\Python23\lib\logging\handlers.py", line 103,
in emit
    self.stream.seek(0, 2)  #due to non-posix-compliant
Windows feature
ValueError: I/O operation on closed file)

I would have created a patch, but I am unsure of what
the correct behaviour should be?

- one possibility would be to continue logging to the
same file (skip rollover), but that is not ideal behaviour

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=995109&group_id=5470


More information about the Python-bugs-list mailing list