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" (for example) is specified and respected, and 
you run the application twice, you would only get log output from the last run 
- not what you would intuitively expect. That's because in the second run, "w" 
would truncate an existing log file. With the mode set to "a", logs from 
multiple runs go into the same file, until rollover occurs - this seems to be 
the commonest use case.

Why do you need to specify "a+" rather than "a"? Do you need to read the log 
file concurrently with it being written, with the same file handle/descriptor?

The provided handlers are for text files, so non-text modes are not appropriate 
either. If you need support for binary files, you can create your own handler 
classes, perhaps based on the existing ones.

Marking as pending, awaiting feedback. Will close in a couple of weeks if none 
received.

----------
assignee: d...@python -> vinay.sajip
nosy:  -d...@python
status: open -> pending

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9512>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to