This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Logging: RotatingFileHandler computes string length instead of byte representation length.
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: alibotean, r.david.murray, vinay.sajip
Priority: normal Keywords:

Created on 2014-01-06 09:19 by alibotean, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rotatingfilehandler.py alibotean, 2014-01-06 09:19
Messages (5)
msg207417 - (view) Author: A. Libotean (alibotean) Date: 2014-01-06 09:19
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.
msg207447 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-01-06 16:00
Could you please upload your proposed fix as a patch file (universal diff)?
msg208023 - (view) Author: A. Libotean (alibotean) Date: 2014-01-13 11:40
Sure, will come back shortly with a patch.
msg208055 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2014-01-13 22:08
Which encoding are you using, such that the difference in length between encoded and decoded messages is significant?
msg210348 - (view) Author: A. Libotean (alibotean) Date: 2014-02-05 21:29
> 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.
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64336
2014-02-05 22:01:55vinay.sajipsetstatus: open -> closed
resolution: not a bug
2014-02-05 21:29:19aliboteansetmessages: + msg210348
2014-01-13 22:08:47vinay.sajipsetmessages: + msg208055
2014-01-13 11:40:23aliboteansetmessages: + msg208023
2014-01-06 16:00:45r.david.murraysetnosy: + r.david.murray, vinay.sajip
messages: + msg207447
2014-01-06 09:19:31aliboteancreate