I have a problem with the python logging. The attached
python file 'log.py' initializes the python logging (rotating
log file) and starts writing lines in a log file.
Everything works, if the line 'log.refresh' is commented
out. If the line is not commented out, I always get an
error by the first rollOver. So each time when I re-
initialize the logging (=method refresh in my code) I get
this error (see below). What can be the problem?
OS information: Windows XP Professional, version
5.1.2600 Service Pack 1
Traceback (most recent call last):
File "log.py", line 21, in ?
log.logger.info(" I am line "+str(i))
File "C:\Python23\lib\logging\__init__.py", line 893, in
info
apply(self._log, (INFO, 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
--------------------------------
PS: Sometimes I also get the error 'ValueError: I/O
operation on closed file'
|