This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rfk
Recipients rfk
Date 2010-09-27.02:02:28
SpamBayes Score 1.5286481e-05
Marked as misclassified No
Message-id <1285552951.71.0.864499786785.issue9957@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-09-27 02:02:31rfksetrecipients: + rfk
2010-09-27 02:02:31rfksetmessageid: <1285552951.71.0.864499786785.issue9957@psf.upfronthosting.co.za>
2010-09-27 02:02:29rfklinkissue9957 messages
2010-09-27 02:02:29rfkcreate