Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
In the following example the rotating file handler writes the message in file "test.log" and creates an empty backup file "test.log.1".
importlogging.handlersfh=logging.handlers.RotatingFileHandler('test.log',maxBytes=100,backupCount=1)fh.emit(logging.makeLogRecord({'msg':'x'*100}))fh.close()
I think creating an empty backup file is meaningless.shouldRollover() should return False ifself.stream.tell() returns 0 (it happens for just created file).
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done