Commit 6f3827d0 by rfkelly0

fix RemoteFileBuffer.truncate() when size is None

parent f8c0a39d
...@@ -139,6 +139,9 @@ class RemoteFileBuffer(object): ...@@ -139,6 +139,9 @@ class RemoteFileBuffer(object):
try: try:
if isinstance(self.file,SpooledTemporaryFile): if isinstance(self.file,SpooledTemporaryFile):
# SpooledTemporaryFile.truncate doesn't accept size argument. # SpooledTemporaryFile.truncate doesn't accept size argument.
if size is None:
self.file._file.truncate()
else:
self.file._file.truncate(size) self.file._file.truncate(size)
else: else:
self.file.truncate(size) self.file.truncate(size)
......
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