[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-23 Thread Friðrik Már Jónsson
Friðrik Már Jónsson frid...@pyth.net added the comment: That's a fair conclusion, but in this case I'd appreciate Terry's suggested doc patch being implemented: DOC PATCH In 15.6.12.5. RotatingFileHandler, replace If mode is not specified, 'a' is used. with If mode is not specified or if

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-22 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Sorry for the slow response, I've been on vacation. The reason why the mode is set to a for rotating file handlers is as follows: the file is supposed to contain events from multiple runs of the program until rollover occurs. If a mode w

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-22 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: I've updated the comment to be more informative in py3k, release27-maint (r84259). -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9512

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-22 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9512 ___ ___

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-22 Thread Friðrik Már Jónsson
Friðrik Már Jónsson frid...@pyth.net added the comment: I agree with your points on the triviality and potential harmfulness of allowing modes like 'b' and 'w'. The '+' mode may be required for loggers that require headers or validation or positioning within an existing file (think XML). One

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-22 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: The rotating handlers provided with the logging package are expected to be simple append-only handlers; if you need more specialised behaviour you need to subclass and implement what you need. The ELFF is about request logging, not

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-05 Thread Friðrik Már Jónsson
Friðrik Már Jónsson frid...@pyth.net added the comment: Thank you. I should have been more clear about what I meant. This this condition was introduced in r38631 by Vinay Sajip having the log message Added optional encoding argument to file handlers. I can't easily see why this piece of code

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-05 Thread Friðrik Már Jónsson
Friðrik Már Jónsson frid...@pyth.net added the comment: It may not have been entirely obvious that what I meant with the Extended Log File Format example is that read access would be optimal. -- ___ Python tracker rep...@bugs.python.org

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-05 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Given that you decided to argue for a code change (which my comment implicitly invited), adding someone (VS in this case) to nosy to respond is the right thing to do and fairly common. Assigning to someone is not, as least not any more. If

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-04 Thread Friðrik Már Jónsson
New submission from Friðrik Már Jónsson frid...@pyth.net: It seems to me that the ``mode`` keyword argument of ``logging.handlers.RotatingFileHandler`` is not respected. Here is an example of opening a nonexistent file:: Python 2.7 (r27:82500, Aug 4 2010, 15:10:49) [GCC 4.3.2] on

[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

2010-08-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I presume your report is about the fact that the mode is 'a' even though you specified 'a+'. The answer is this block from RotatingFileHandler.__init__ (3.1.2, but presume same for 2.x): if maxBytes 0: mode = 'a' # doesn't