New submission from Ryan Kelly <ryan at rfk.id.au>:
Both file.truncate() and StringIO.truncate() accept an optional "size" parameter to truncate the file to a specific size. SpooledTemporaryFile should accept a similar parameter and pass it on.
The only tricky part is that truncate can potentially increase the size of a file, so it needs to check the max size and rollover if appropriate.
Patch is against py3k branch; should work on trunk modulo the use of b"xxx" in the tests.
----------
components: Library (Lib)
files: spooledtemporaryfile_truncate.patch
keywords: patch
messages: 117436
nosy: rfk
priority: normal
severity: normal
status: open
title: SpooledTemporayFile.truncate should take size parameter
type: behavior
Added file: http://bugs.python.org/file19027/spooledtemporaryfile_truncate.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9957>
_______________________________________