Beispiel #1
0
    def close(self):
        if not self.close_called:
            if any(x in self.file.mode for x in 'wa'):
                self.file.write(self.encryptor.finalize())

            if self.delete:
                os.remove(self.keypath)

        return _TemporaryFileWrapper.close(self)
Beispiel #2
0
    def close(self):
        if not self.close_called:
            try:
                if any(x in self.file.mode for x in 'wa') and not self.encryptor_finalized:
                    self.encryptor_finalized = True
                    self.file.write(self.encryptor.finalize())

            except:
                pass

            finally:
                if self.delete:
                    overwrite_and_remove(self.keypath)

        try:
            _TemporaryFileWrapper.close(self)
        except:
            pass
Beispiel #3
0
    def close(self):
        if not self.close_called:
            if any(x in self.file.mode for x in 'wa'):
                self.file.write(self.encryptor.finalize())

            if self.delete:
                os.remove(self.keypath)

        return _TemporaryFileWrapper.close(self)
Beispiel #4
0
    def close(self):
        if not self.close_called:
            try:
                if any(x in self.file.mode for x in 'wa') and not self.encryptor_finalized:
                    self.encryptor_finalized = True
                    self.file.write(self.encryptor.finalize())

            except:
                pass

            finally:
                if self.delete:
                    os.remove(self.keypath)

        try:
            _TemporaryFileWrapper.close(self)
        except:
            pass
Beispiel #5
0
 def close(self):
     if any(x in self.file.mode for x in 'wa') and not self.close_called:
         self.file.write(self.encryptor.finalize())
     return _TemporaryFileWrapper.close(self)
Beispiel #6
0
 def close(self):
     return _TemporaryFileWrapper.close(self)
Beispiel #7
0
 def close(self):
     if any(x in self.file.mode for x in 'wa') and not self.close_called:
         self.file.write(self.encryptor.finalize())
     return _TemporaryFileWrapper.close(self)
 def close(self):
     return _TemporaryFileWrapper.close(self)