summaryrefslogtreecommitdiffstats
path: root/Modules/_bytesio.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-27 21:48:46 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-27 21:48:46 (GMT)
commitca5a06aaa968ae767329f8afedbaf17fc337416f (patch)
tree1c0f8bfdd0469ce707d41b99371855f6f3f8ae91 /Modules/_bytesio.c
parentf3330144679453a66b9baf54963462d8cbd095f8 (diff)
downloadcpython-ca5a06aaa968ae767329f8afedbaf17fc337416f.zip
cpython-ca5a06aaa968ae767329f8afedbaf17fc337416f.tar.gz
cpython-ca5a06aaa968ae767329f8afedbaf17fc337416f.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/_bytesio.c')
-rw-r--r--Modules/_bytesio.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Modules/_bytesio.c b/Modules/_bytesio.c
index d342838..bbbb156 100644
--- a/Modules/_bytesio.c
+++ b/Modules/_bytesio.c
@@ -445,7 +445,6 @@ bytesio_truncate(BytesIOObject *self, PyObject *args)
if (resize_buffer(self, size) < 0)
return NULL;
}
- self->pos = size;
return PyInt_FromSsize_t(size);
}