Skip to content

RotatingFileHandler uses tell in non-binary mode to determine size of the file in bytes #69128

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
Kentzo mannequin opened this issue Aug 26, 2015 · 3 comments
Closed

Comments

@Kentzo
Copy link
Mannequin

Kentzo mannequin commented Aug 26, 2015

BPO 24940
Nosy @vsajip, @Kentzo

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 2016-08-03.15:04:37.144>
created_at = <Date 2015-08-26.03:18:01.800>
labels = ['invalid']
title = 'RotatingFileHandler uses tell in non-binary mode to determine size of the file in bytes'
updated_at = <Date 2016-08-03.15:04:37.143>
user = 'https://github.com/Kentzo'

bugs.python.org fields:

activity = <Date 2016-08-03.15:04:37.143>
actor = 'vinay.sajip'
assignee = 'none'
closed = True
closed_date = <Date 2016-08-03.15:04:37.144>
closer = 'vinay.sajip'
components = []
creation = <Date 2015-08-26.03:18:01.800>
creator = 'Ilya.Kulakov'
dependencies = []
files = []
hgrepos = []
issue_num = 24940
keywords = []
message_count = 3.0
messages = ['249177', '252717', '257033']
nosy_count = 2.0
nosy_names = ['vinay.sajip', 'Ilya.Kulakov']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue24940'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

@Kentzo
Copy link
Mannequin Author

Kentzo mannequin commented Aug 26, 2015

According to the most recent documentation:

Return the current stream position as an opaque number. The number does not usually represent a number of bytes in the underlying binary storage.

Therefore stream should be opened as 'ab' by using value of the encoding argument or sys.getdefaultencoding if it's None.

@vsajip
Copy link
Member

vsajip commented Oct 10, 2015

But this is a change in behaviour which might cause people a problem. The way it is now, the size may be approximate rather than exact, which is reasonable for the use case.

@vsajip
Copy link
Member

vsajip commented Dec 26, 2015

I propose to close this as not a bug, as the exact rollover size is just meant to be in the close ball-park rather than to the exact byte.

@vsajip vsajip added the invalid label Dec 26, 2015
@vsajip vsajip closed this as completed Aug 3, 2016
@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
None yet
Projects
None yet
Development

No branches or pull requests

1 participant