The builtin file object has the following behavior for the appending ('a') mode: 'The file will be created if it doesn't exist when opened for writing or appending' Currently, the file must already exist and it must not be an empty file. This patch achieves the file object's behavior with a small one-line addition. If this patch be used, please add a reference to 'herrwitten' in the log.
Thank you for the idea. As your patch only implemented appending to empty files, I added support for creating files if they don't exist. I added a testcase and adjusted the docs as well. Checked in the trunk as rev. 53648, so it will appear in 2.6.