summaryrefslogtreecommitdiffstats
path: root/Modules/_io/stringio.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-31 22:26:04 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-31 22:26:04 (GMT)
commitf3fa07470381b4f54b2d3f911fc22624e9b0b27d (patch)
tree5368b993641d34b3824a79896bf18c8f9097ce5c /Modules/_io/stringio.c
parente70c72c06b169a36170ab68ec52bda9a87c16274 (diff)
downloadcpython-f3fa07470381b4f54b2d3f911fc22624e9b0b27d.zip
cpython-f3fa07470381b4f54b2d3f911fc22624e9b0b27d.tar.gz
cpython-f3fa07470381b4f54b2d3f911fc22624e9b0b27d.tar.bz2
- Issue #6939: Fix file I/O objects in the `io` module to keep the original
file position when calling `truncate()`. It would previously change the file position to the given argument, which goes against the tradition of ftruncate() and other truncation APIs. Patch by Pascal Chambon.
Diffstat (limited to 'Modules/_io/stringio.c')
-rw-r--r--Modules/_io/stringio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index a5bfd79..505bde0 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -350,7 +350,7 @@ PyDoc_STRVAR(stringio_truncate_doc,
"Truncate size to pos.\n"
"\n"
"The pos argument defaults to the current file position, as\n"
- "returned by tell(). Imply an absolute seek to pos.\n"
+ "returned by tell(). The current file position is unchanged.\n"
"Returns the new absolute position.\n");
static PyObject *
@@ -390,7 +390,6 @@ stringio_truncate(stringio *self, PyObject *args)
return NULL;
self->string_size = size;
}
- self->pos = size;
return PyLong_FromSsize_t(size);
}