def _setFile(self, data, precondition=None): if data is not None and self.hasData() and \ str(data.read()) == str(self.getData()): # Same data as previous, no need to change it's content return CMFFile._edit(self, precondition=precondition, file=data)