[Python-checkins] r68550 - sandbox/trunk/io-c/_textio.c
antoine.pitrou
python-checkins at python.org
Mon Jan 12 21:06:38 CET 2009
Author: antoine.pitrou
Date: Mon Jan 12 21:06:38 2009
New Revision: 68550
Log:
add checking for telling flag in text.seek()
Modified:
sandbox/trunk/io-c/_textio.c
Modified: sandbox/trunk/io-c/_textio.c
==============================================================================
--- sandbox/trunk/io-c/_textio.c (original)
+++ sandbox/trunk/io-c/_textio.c Mon Jan 12 21:06:38 2009
@@ -1580,6 +1580,11 @@
"underlying stream is not seekable");
goto fail;
}
+ if (!self->telling) {
+ PyErr_SetString(PyExc_IOError,
+ "telling position disabled by next() call");
+ goto fail;
+ }
res = PyObject_CallMethod((PyObject *)self, "flush", NULL);
if (res == NULL)
More information about the Python-checkins
mailing list