[New-bugs-announce] [issue25121] python logger can't wrap log file and blows with traceback

Alexander Belchenko report at bugs.python.org
Tue Sep 15 10:57:34 CEST 2015


New submission from Alexander Belchenko:

We're using standard logging library for logs. On machine of my colleague there is constantly traceback like this:

[11:21:29] <altuhkov> PermissionError: [WinError 32] The process cannot access the file because it is
being used by another process: 'C:\\Users\\Andrew\\Desktop\\server\\logs\\2015-0
9-09_10-44-03\\2015-09-09_10-44-04-middleman-684.log.1'
Logged from file middleman.py, line 379
Traceback (most recent call last):
  File "c:\python33\lib\logging\handlers.py", line 73, in emit
    self.doRollover()
  File "c:\python33\lib\logging\handlers.py", line 176, in doRollover
    self.rotate(self.baseFilename, dfn)
  File "c:\python33\lib\logging\handlers.py", line 116, in rotate
    os.rename(source, dest)

middleman.py, line 379 is simple call to logger.debug:

    self.logger.debug('node %s is already processing, packet %s postponed', node_id, packet_no) 

It's strange that another log file with different basename in the same logs directory is wrapping without problems.

Anyway, my complain is about traceback. I don't think it's good behavior that my application crashes because logging library can't wrap file. The problem for me - I have no idea how to catch and ignore such problem, because it's in the logging internals.

----------
components: Library (Lib), Windows
messages: 250747
nosy: bialix, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python logger can't wrap log file and blows with traceback
type: crash
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25121>
_______________________________________


More information about the New-bugs-announce mailing list