'Modify `filename`, replacing its contents with `self.contents`. If
`self.contents` is empty, the file remains unchanged.'

def overwrite_contents(self, filename, log):

    if self.contents:
        with codecs.open(filename, 'w', encoding='utf-8') as f:
            f.write(self.contents)
