Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimedRotatingFileHandler backupCount not working #89791

Closed
ivogrondman mannequin opened this issue Oct 27, 2021 · 6 comments
Closed

TimedRotatingFileHandler backupCount not working #89791

ivogrondman mannequin opened this issue Oct 27, 2021 · 6 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir

Comments

@ivogrondman
Copy link
Mannequin

ivogrondman mannequin commented Oct 27, 2021

BPO 45628
Nosy @vsajip, @miss-islington
PRs
  • bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) #29310
  • [3.9] bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) (GH-29313) #29313
  • [3.10] bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) (GH-29314) #29314
  • Files
  • logrotate.py: Example script
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-10-29.15:27:27.359>
    created_at = <Date 2021-10-27.15:23:13.131>
    labels = ['library', '3.10']
    title = 'TimedRotatingFileHandler backupCount not working'
    updated_at = <Date 2022-01-28.23:18:45.219>
    user = 'https://bugs.python.org/ivogrondman'

    bugs.python.org fields:

    activity = <Date 2022-01-28.23:18:45.219>
    actor = 'brandtbucher'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-29.15:27:27.359>
    closer = 'vinay.sajip'
    components = ['Library (Lib)']
    creation = <Date 2021-10-27.15:23:13.131>
    creator = 'ivogrondman'
    dependencies = []
    files = ['50397']
    hgrepos = []
    issue_num = 45628
    keywords = ['patch']
    message_count = 6.0
    messages = ['405104', '405304', '405310', '405311', '405312', '405316']
    nosy_count = 3.0
    nosy_names = ['vinay.sajip', 'miss-islington', 'ivogrondman']
    pr_nums = ['29310', '29313', '29314']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45628'
    versions = ['Python 3.10']

    @ivogrondman
    Copy link
    Mannequin Author

    ivogrondman mannequin commented Oct 27, 2021

    Using the TimedRotatingFileHandler with a non-zero backupCount, I get different behaviour between versions 3.9 and 3.10.

    Attached is a small example. Running it with 3.9 gives me two backups at most even if I run the script for a long time. Running it with 3.10 does not delete old backup files at all and just keeps writing new ones.

    @ivogrondman ivogrondman mannequin added OS-mac 3.10 only security fixes stdlib Python modules in the Lib dir labels Oct 27, 2021
    @vsajip
    Copy link
    Member

    vsajip commented Oct 29, 2021

    New changeset 8a77f59 by Vinay Sajip in branch 'main':
    bpo-45628: Check all parts of the suffix for an extension match. (GH-29310)
    8a77f59

    @vsajip
    Copy link
    Member

    vsajip commented Oct 29, 2021

    New changeset 317e0c9 by Miss Islington (bot) in branch '3.9':
    [3.9] bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) (GH-29313)
    317e0c9

    @vsajip
    Copy link
    Member

    vsajip commented Oct 29, 2021

    New changeset 191a939 by Miss Islington (bot) in branch '3.10':
    [3.10] bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) (GH-29314)
    191a939

    @vsajip
    Copy link
    Member

    vsajip commented Oct 29, 2021

    N.B. I was able to reproduce this on recent 3.9 versions as well.

    @vsajip vsajip closed this as completed Oct 29, 2021
    @vsajip vsajip closed this as completed Oct 29, 2021
    @vsajip
    Copy link
    Member

    vsajip commented Oct 29, 2021

    It's possible this crept in during the fix for bpo-44753.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants