release function raises exception when file handler is already closed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Concurrent Log Handler for Python |
New
|
Undecided
|
Unassigned |
Bug Description
In ConcurrentRotat
self.stream.flush()
If the file handler is already closed, a ValueError is raised ("I/O operation on closed file").
You can wrap the code is a try block like so to avoid such problem:
def release(self):
""" Release file and thread locks. Flush stream and take care of closing
stream in 'degraded' mode. """
try:
if self._rotateFailed:
except ValueError:
pass # I/O operation on closed file
finally:
try:
# release thread lock