def _pre_message_hook(self, f): """Called before writing each message to file f.""" if f.tell() != 0: f.write(os.linesep)