Issue 5013: Fixed bug in FileHandler when delay was set.
This commit is contained in:
parent
933d3a7a54
commit
5fb11b2b85
|
@ -1,4 +1,4 @@
|
||||||
# Copyright 2001-2008 by Vinay Sajip. All Rights Reserved.
|
# Copyright 2001-2009 by Vinay Sajip. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, and distribute this software and its
|
# Permission to use, copy, modify, and distribute this software and its
|
||||||
# documentation for any purpose and without fee is hereby granted,
|
# documentation for any purpose and without fee is hereby granted,
|
||||||
|
@ -21,7 +21,7 @@ comp.lang.python, and influenced by Apache's log4j system.
|
||||||
Should work under Python versions >= 1.5.2, except that source line
|
Should work under Python versions >= 1.5.2, except that source line
|
||||||
information is not available unless 'sys._getframe()' is.
|
information is not available unless 'sys._getframe()' is.
|
||||||
|
|
||||||
Copyright (C) 2001-2008 Vinay Sajip. All Rights Reserved.
|
Copyright (C) 2001-2009 Vinay Sajip. All Rights Reserved.
|
||||||
|
|
||||||
To use, simply 'import logging' and log away!
|
To use, simply 'import logging' and log away!
|
||||||
"""
|
"""
|
||||||
|
@ -46,8 +46,8 @@ except ImportError:
|
||||||
|
|
||||||
__author__ = "Vinay Sajip <vinay_sajip@red-dove.com>"
|
__author__ = "Vinay Sajip <vinay_sajip@red-dove.com>"
|
||||||
__status__ = "production"
|
__status__ = "production"
|
||||||
__version__ = "0.5.0.6"
|
__version__ = "0.5.0.7"
|
||||||
__date__ = "03 December 2008"
|
__date__ = "20 January 2009"
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Miscellaneous module data
|
# Miscellaneous module data
|
||||||
|
@ -740,7 +740,6 @@ class StreamHandler(Handler):
|
||||||
if strm is None:
|
if strm is None:
|
||||||
strm = sys.stderr
|
strm = sys.stderr
|
||||||
self.stream = strm
|
self.stream = strm
|
||||||
self.formatter = None
|
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
"""
|
"""
|
||||||
|
@ -795,10 +794,12 @@ class FileHandler(StreamHandler):
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
self.encoding = encoding
|
self.encoding = encoding
|
||||||
if delay:
|
if delay:
|
||||||
|
#We don't open the stream, but we still need to call the
|
||||||
|
#Handler constructor to set level, formatter, lock etc.
|
||||||
|
Handler.__init__(self)
|
||||||
self.stream = None
|
self.stream = None
|
||||||
else:
|
else:
|
||||||
stream = self._open()
|
StreamHandler.__init__(self, self._open())
|
||||||
StreamHandler.__init__(self, stream)
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""
|
"""
|
||||||
|
@ -830,8 +831,7 @@ class FileHandler(StreamHandler):
|
||||||
constructor, open it before calling the superclass's emit.
|
constructor, open it before calling the superclass's emit.
|
||||||
"""
|
"""
|
||||||
if self.stream is None:
|
if self.stream is None:
|
||||||
stream = self._open()
|
self.stream = self._open()
|
||||||
StreamHandler.__init__(self, stream)
|
|
||||||
StreamHandler.emit(self, record)
|
StreamHandler.emit(self, record)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
|
@ -145,6 +145,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
|
||||||
|
parameter was set.
|
||||||
|
|
||||||
- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
|
- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
|
||||||
which inherited from numbers.py which did not have __slots__ defined. The
|
which inherited from numbers.py which did not have __slots__ defined. The
|
||||||
numbers heirarchy now has its own __slots__ declarations.
|
numbers heirarchy now has its own __slots__ declarations.
|
||||||
|
|
Loading…
Reference in New Issue