[New-bugs-announce] [issue4749] Issue with RotatingFileHandler logging handler on Windows

Mohammad Al report at bugs.python.org
Fri Dec 26 13:46:46 CET 2008


New submission from Mohammad Al <mramahi77 at hotmail.com>:

It seems that RotatingFileHandler  is experiencing an issue when 
attempting to rotate log files under Windows. The following errors are 
received:

Traceback (most recent call last):
  File "C:\Python25\lib\logging\handlers.py", line 73, in emit
    if self.shouldRollover(record):
  File "C:\Python25\lib\logging\handlers.py", line 147, in 
shouldRollover
    self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
ValueError: I/O operation on closed file
Traceback (most recent call last):
  File "C:\Python25\lib\logging\handlers.py", line 73, in emit
    if self.shouldRollover(record):

I tried the code on Python 2.5.2 and 2.5.4 under Windows XP SP 2, with 
the same results. To reproduce run the attached scripts few times. The 
first time the handlers attempt to rotate the log files the error 
message above is received. 

In addition to crashing the application, log files are getting lost as 
a result, which is a serious issue. 

I have seen few complaints about this issue, but tickets were closed 
without a real resolution to the issue (unless I missed something)

----------
components: Library (Lib)
files: rothandlerbug.py
messages: 78293
nosy: mramahi77
severity: normal
status: open
title: Issue with RotatingFileHandler logging handler on Windows
type: crash
versions: Python 2.4, Python 2.5
Added file: http://bugs.python.org/file12449/rothandlerbug.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4749>
_______________________________________


More information about the New-bugs-announce mailing list