[ python-Bugs-939836 ] Logging failes for rotating file log (during rollOver)

SourceForge.net noreply at sourceforge.net
Thu Apr 22 16:57:12 EDT 2004


Bugs item #939836, was opened at 2004-04-22 02:25
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=939836&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: smeyers2002 (smeyers2002)
>Assigned to: Vinay Sajip (vsajip)
Summary: Logging failes for rotating file log (during rollOver)

Initial Comment:
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'

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=939836&group_id=5470



More information about the Python-bugs-list mailing list