[docs] An error report for python 2.6.5 logging module

陈卫国 chenweiguo315 at gmail.com
Thu Dec 22 10:51:37 CET 2011


hi,all:

I want to report an error in Python2.6.5 Logging module like this:

'
*Traceback (most recent call last):*
*  File "/usr/local/lib/python2.6/logging/handlers.py", line 72, in emit*
*    self.doRollover()*
*  File "/usr/local/lib/python2.6/logging/handlers.py", line 324, in
doRollover*
*    os.rename(self.baseFilename, dfn)*
*OSError: [Errno 2] No such file or directory*
*'*
*
*
It happens when use class 'TimedRotatingFileHandler'. After the class
instance creates, if you don't instert any log message into the log file
until the rollover condition meet. so the process will do "doRollover"
function. But this function don't check the source log file whether exist.
At last, this Error happens.

*fix advice*: add 'os.path.exists' function before 'os.rename'.



Best Regards.

Weiguo Chen
Beijing China.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20111222/d37256fb/attachment-0001.html>


More information about the docs mailing list