[issue9957] SpooledTemporayFile.truncate should take size parameter

Ryan Kelly report at bugs.python.org
Mon Sep 27 04:02:31 CEST 2010


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>
_______________________________________


More information about the Python-bugs-list mailing list