Commit 18e4fae2 by rfkelly0

workaround for issue #21

parent 8c6757f2
...@@ -133,6 +133,10 @@ class RemoteFileBuffer(object): ...@@ -133,6 +133,10 @@ class RemoteFileBuffer(object):
def truncate(self,size=None): def truncate(self,size=None):
self._lock.acquire() self._lock.acquire()
try: try:
if isinstance(self.file,SpooledTemporaryFile):
# SpooledTemporaryFile.truncate doesn't accept size argument.
self.file._file.truncate(size)
else:
self.file.truncate(size) self.file.truncate(size)
self.flush() self.flush()
finally: finally:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment