This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jvickroy
Recipients
Date 2003-11-14.15:38:54
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Python version:
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 
32 bit (Intel)] on win32

Operating System:
MS Windows 2000 Professional with all latest patches

Synopsis:

When reassigning a handler (RotatingFileSystem) to a 
logger during execution, close() must be invoked against 
the current handler.  Failure to do so causes the 
following exception to be raised:

 Traceback (most recent call last):
   File
 "C:\Python23\lib\site-
packages\Pythonwin\pywin\framework\scriptutils.py",
 line 310, in RunScript
     exec codeObject in __main__.__dict__
   File "E:\$PROJECTS\experimental\Py Logging\t_xc.py", 
line 61, in ?
     log.error('testing Python logging module')
   File "C:\Python23\lib\logging\__init__.py", line 923, in 
error
     apply(self._log, (ERROR, msg, args), kwargs)
   File "C:\Python23\lib\logging\__init__.py", line 994, in 
_log
     self.handle(record)
   File "C:\Python23\lib\logging\__init__.py", line 1004, in 
handle
     self.callHandlers(record)
   File "C:\Python23\lib\logging\__init__.py", line 1037, in 
callHandlers
     hdlr.handle(record)
   File "C:\Python23\lib\logging\__init__.py", line 592, in 
handle
     self.emit(record)
   File "C:\Python23\lib\logging\handlers.py", line 105, in 
emit
     self.doRollover()
   File "C:\Python23\lib\logging\handlers.py", line 90, in 
doRollover
     os.rename(self.baseFilename, dfn)
 OSError: [Errno 13] Permission denied

If close() is applied to each handler, except the final 
assigned handler, then logging.shutdown() raises the 
following exception when it is applied prior to application 
termination:

Traceback (most recent call last):
  File "D:\$PROJECTS\experimental\Py Logging\t_xb.py", 
line 63, in ?
    shutdown()
  File "C:\Python23\lib\logging\__init__.py", line 1195, in 
shutdown
    h.flush()
  File "C:\Python23\lib\logging\__init__.py", line 661, in 
flush
    self.stream.flush()
ValueError: I/O operation on closed file

apparently, because it is attempting to close previously-
closed handlers.

Please, see attachment for a relevant script.

If it is agreed that this is an appropriate use of the 
logging system (and I think it is <smile>), I would be 
willing to attempt a patch if that is preferable.

Thanks for your time.
History
Date User Action Args
2007-08-23 14:18:15adminlinkissue842170 messages
2007-08-23 14:18:15admincreate