logging.shutdown() ValueError: I/O operation on closed file

Peter Otten __peter__ at web.de
Fri Nov 14 03:01:46 EST 2003


j vickroy wrote:

> 
> Here is the result of not closing a handler manually -- Peter's suggestion
> (3)
> 
> 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

Works here. Consider switching to an OS where you can rename an open file...
Well, you read my discalimer :-) 

Peter






More information about the Python-list mailing list