[docs] An error report for python 2.6.5 logging module

Sandro Tosi sandro.tosi at gmail.com
Sat Dec 24 15:40:48 CET 2011

Hello Weiguo Chen,

On Thu, Dec 22, 2011 at 10:51, 陈卫国 <chenweiguo315 at gmail.com> wrote:
> I want to report an error in Python2.6.5 Logging module like this:

please note a couple of things:

- this mailing list is not for reporting general bugs on Python, but
only for its documentation
- Python 2.6.5 is in security fix-only mode, so no general bugfixes
are performed on this release, so you probably would like to update to
python 2.7 or even to the current Python3 stable release, 3.2

> 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'.

Could you please file an issue on http://bugs.python.org/ , possibly
with a sample code to replicate this problem? I've tried with 2.7, but
I was only able to replicate it removing explicitly the filename.

Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

More information about the docs mailing list