Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RotatingFileHandler can create empty backups #116263

Closed
Assignees
serhiy-storchaka
Labels
3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error
@serhiy-storchaka

Description

@serhiy-storchaka

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

Labels

3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp