Title: RotatingFileHandler uses tell in non-binary mode to determine size of the file in bytes
Type: Stage: resolved
Components: Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Ilya.Kulakov, vinay.sajip
Priority: normal Keywords:

Created on 2015-08-26 03:18 by Ilya.Kulakov, last changed 2016-08-03 15:04 by vinay.sajip. This issue is now closed.

Messages (3)
msg249177 - (view) Author: Ilya Kulakov (Ilya.Kulakov) * Date: 2015-08-26 03:18
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.
msg252717 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2015-10-10 14:49
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.
msg257033 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2015-12-26 13:15
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.
Date User Action Args
2016-08-03 15:04:37vinay.sajipsetstatus: pending -> closed
stage: resolved
2015-12-26 13:15:38vinay.sajipsetstatus: open -> pending
resolution: not a bug
messages: + msg257033
2015-10-10 14:49:29vinay.sajipsetmessages: + msg252717
2015-08-26 11:56:47r.david.murraysetnosy: + vinay.sajip
2015-08-26 03:18:02Ilya.Kulakovcreate