SFTP: fix a bug that caused the temporary files underlying EncryptedTemporaryFiles not to be closed.

This commit is contained in:
david-sarah 2010-05-31 22:53:10 -07:00
parent de95140b7b
commit db394671e9

View File

@ -557,13 +557,13 @@ class OverwriteableFileConsumer(PrefixingLogMixin):
#self.unregisterProducer()
def close(self):
self.is_closed = True
self.finish()
if not self.is_closed:
self.is_closed = True
try:
self.f.close()
except BaseException as e:
self.log("suppressed %r from close of temporary file %r" % (e, self.f), level=WEIRD)
self.finish()
def unregisterProducer(self):
if self.producer: