[New-bugs-announce] [issue3738] logging.Handler.close does something

David W. Lambert report at bugs.python.org
Sat Aug 30 14:13:13 CEST 2008


New submission from David W. Lambert <lambertdw at corning.com>:

Library documents claim that logging.Handler.close does nothing, but 
the source code shows otherwise---it removes itself from the internal 
handler list.  The error propagates treelike through the subclasses.  
(I found references to close in stream handler flush and 
NTEventLogHandler subclass).  I have source code for version 2.5, but 
the error likely persists through version 3.03b which 

http://docs.python.org/dev/3.0/library/logging.html#logging.StreamHandl
er

claims,

"flush()¶ 
Flushes the stream by calling its flush() method. Note that the close
() method is inherited from Handler and so does nothing, so an 
explicit flush() call may be needed at times.
"

Actually, before reading the manual I tried

del streamHandler_on_my_stream; my_stream.close()

which didn't fix subsequent log messages that reported failure writing 
to closed stream.  __del__ might be easy to implement, and it seems 
natural.

Respectfully,
Dave

----------
assignee: georg.brandl
components: Documentation
messages: 72191
nosy: LambertDW, georg.brandl
severity: normal
status: open
title: logging.Handler.close does something
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0

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


More information about the New-bugs-announce mailing list