def close(self):
    if self.compress:
        with open(self._filename, 'wb') as zfile:
            write_zfile(zfile, self.file.getvalue(), self.compress)
def close(self):
    if self.compress:
        with open(self._filename, 'wb') as zfile:
            write_zfile(zfile, self.file.getvalue(), self.compress)