Skip to content

Logging: RotatingFileHandler computes string length instead of byte representation length. #64336

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

Closed
alibotean mannequin opened this issue Jan 6, 2014 · 5 comments
Closed
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@alibotean
Copy link
Mannequin

alibotean mannequin commented Jan 6, 2014

BPO 20137
Nosy @vsajip, @bitdancer
Files
  • rotatingfilehandler.py
  • 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 2014-02-05.22:01:55.693>
    created_at = <Date 2014-01-06.09:19:31.638>
    labels = ['invalid', 'type-bug', 'library']
    title = 'Logging: RotatingFileHandler computes string length instead of byte representation length.'
    updated_at = <Date 2014-02-05.22:01:55.692>
    user = 'https://bugs.python.org/alibotean'

    bugs.python.org fields:

    activity = <Date 2014-02-05.22:01:55.692>
    actor = 'vinay.sajip'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-02-05.22:01:55.693>
    closer = 'vinay.sajip'
    components = ['Library (Lib)']
    creation = <Date 2014-01-06.09:19:31.638>
    creator = 'alibotean'
    dependencies = []
    files = ['33322']
    hgrepos = []
    issue_num = 20137
    keywords = []
    message_count = 5.0
    messages = ['207417', '207447', '208023', '208055', '210348']
    nosy_count = 3.0
    nosy_names = ['vinay.sajip', 'r.david.murray', 'alibotean']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue20137'
    versions = ['Python 2.7']

    @alibotean
    Copy link
    Mannequin Author

    alibotean mannequin commented Jan 6, 2014

    Current implementation of RotatingFileHandler ignores the encoding when computing the entry byte length.

    I've attached a modified version that will compute the entry lenght in bytes.

    @alibotean alibotean mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 6, 2014
    @bitdancer
    Copy link
    Member

    Could you please upload your proposed fix as a patch file (universal diff)?

    @alibotean
    Copy link
    Mannequin Author

    alibotean mannequin commented Jan 13, 2014

    Sure, will come back shortly with a patch.

    @vsajip
    Copy link
    Member

    vsajip commented Jan 13, 2014

    Which encoding are you using, such that the difference in length between encoded and decoded messages is significant?

    @alibotean
    Copy link
    Mannequin Author

    alibotean mannequin commented Feb 5, 2014

    Which encoding are you using, such that the difference in length between encoded and decoded messages is significant?

    I agree right off the bat that the error in size is not significant. Only the length of the last appended line is computed erroneously.

    I'm uploading the patch in case you decide to apply it.

    Thanks.

    @vsajip vsajip closed this as completed Feb 5, 2014
    @vsajip vsajip added the invalid label Feb 5, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants