cpython: 5a6911930bad (original) (raw)

Mercurial > cpython

changeset 73737:5a6911930bad

Issue #9957: SpooledTemporaryFile.truncate() now accepts an optional size parameter, as other file-like objects. Patch by Ryan Kelly. [#9957]

Antoine Pitrou solipsis@pitrou.net
date Fri, 25 Nov 2011 18:03:09 +0100
parents 905b6f1eca74
children e1dbc72bd97f
files Lib/tempfile.py Lib/test/test_tempfile.py Misc/NEWS
diffstat 3 files changed, 31 insertions(+), 3 deletions(-)[+] [-] Lib/tempfile.py 9 Lib/test/test_tempfile.py 21 Misc/NEWS 4

line wrap: on

line diff

--- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -578,8 +578,13 @@ class SpooledTemporaryFile: def tell(self): return self._file.tell()

def write(self, s): file = self._file

--- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -846,6 +846,27 @@ class test_SpooledTemporaryFile(TC): pass self.assertRaises(ValueError, use_closed)

test_classes.append(test_SpooledTemporaryFile)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -386,10 +386,12 @@ Core and Builtins